forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnn.yaml
164 lines (139 loc) · 5.29 KB
/
nn.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Loss functions
- name: _thnn_binary_cross_entropy(Tensor self, Tensor target, Tensor? weight={}, int64_t reduction=Reduction::Mean)
cname: BCECriterion
scalar_check:
output: 'false'
grad_input: 'false'
# Using this section you can specify what scalar types should be used for each backend
# to generate backward and forward methods
# If not specified, ['Float', 'Double', 'Half'] will be used
CPU:
forward_scalar_types: ['Float', 'Double', 'Half']
backward_scalar_types: ['Float', 'Double', 'Half']
CUDA:
forward_scalar_types: ['Float', 'Double', 'Half']
backward_scalar_types: ['Float', 'Double', 'Half']
- name: _thnn_l1_loss(Tensor self, Tensor target, int64_t reduction=Reduction::Mean)
cname: AbsCriterion
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_mse_loss(Tensor self, Tensor target, int64_t reduction=Reduction::Mean)
cname: MSECriterion
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_multi_margin_loss(Tensor self, LongTensor target, Scalar p=1, Scalar margin=1, Tensor? weight={}, int64_t reduction=Reduction::Mean)
cname: MultiMarginCriterion
scalar_check:
output: reduction != Reduction::None || self_->dim() == 0 || (reduction == Reduction::None && self_->dim() == 1)
- name: _thnn_multilabel_margin_loss(Tensor self, LongTensor target, int64_t reduction=Reduction::Mean)
cname: MultiLabelMarginCriterion
buffers: [is_target]
scalar_check:
output: reduction != Reduction::None || self_->dim() == 0
is_target: target_->dim() == 0
- name: _thnn_nll_loss(Tensor self, LongTensor target, Tensor? weight={}, int64_t reduction=Reduction::Mean, int64_t ignore_index=-100)
cname: ClassNLLCriterion
buffers: [total_weight]
scalar_check:
output: reduction != Reduction::None || self_->dim() == 0
total_weight: 'true'
CPU:
forward_scalar_types: ['Float', 'Double', 'Half', 'BFloat16']
backward_scalar_types: ['Float', 'Double', 'Half', 'BFloat16']
- name: _thnn_nll_loss2d(Tensor self, LongTensor target, Tensor? weight={}, int64_t reduction=Reduction::Mean, int64_t ignore_index=-100)
cname: SpatialClassNLLCriterion
buffers: [total_weight]
scalar_check:
output: reduction != Reduction::None || self_->dim() == 0
total_weight: 'true'
- name: _thnn_smooth_l1_loss(Tensor self, Tensor target, int64_t reduction=Reduction::Mean)
cname: SmoothL1Criterion
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_soft_margin_loss(Tensor self, Tensor target, int64_t reduction=Reduction::Mean)
cname: SoftMarginCriterion
scalar_check:
output: 'false'
grad_input: 'false'
# Activation functions
- name: _thnn_elu(Tensor self, Scalar alpha=1, Scalar scale=1, Scalar input_scale=1)
cname: ELU
has_inplace: True
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_glu(Tensor self, int64_t dim=-1)
cname: GatedLinear
wrap_dim:
dim: self
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_hardtanh(Tensor self, Scalar min_val=-1, Scalar max_val=1)
cname: HardTanh
has_inplace: True
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_leaky_relu(Tensor self, Scalar negative_slope=0.01)
cname: LeakyReLU
has_inplace: True
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_log_sigmoid(Tensor self)
cname: LogSigmoid
buffers: [buffer]
scalar_check:
output: 'false'
buffer: 'false'
grad_input: 'false'
# NOTE: we treat noise as an input (it's really a buffer) because the codegen
# can't handle in-place functions that have buffers
- name: _thnn_rrelu_with_noise(Tensor self, Tensor noise, Scalar lower=0.125, Scalar upper=0.3333333333333333, bool training=false, Generator* generator=nullptr)
cname: RReLU
has_inplace: True
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_softplus(Tensor self, Scalar beta=1, Scalar threshold=20)
cname: SoftPlus
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_softshrink(Tensor self, Scalar lambd=0.5)
cname: SoftShrink
scalar_check:
output: 'false'
grad_input: 'false'
# Private functions. These also exist in TH, but we want the backwards functions
# to implement derivatives.
- name: _thnn_sigmoid(Tensor self)
cname: Sigmoid
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_tanh(Tensor self)
cname: Tanh
scalar_check:
output: 'false'
grad_input: 'false'
# Convolutions
- name: _thnn_conv2d(Tensor self, Tensor weight, IntArrayRef[2] kernel_size, Tensor? bias={}, IntArrayRef[2] stride=1, IntArrayRef[2] padding=0)
cname: SpatialConvolutionMM
buffers: [finput, fgrad_input]
CPU:
forward_scalar_types: ['Float', 'Double', 'Long']
backward_scalar_types: ['Float', 'Double']
- name: _thnn_conv_depthwise2d(Tensor self, Tensor weight, IntArrayRef[2] kernel_size, Tensor? bias={}, IntArrayRef[2] stride=1, IntArrayRef[2] padding=0, IntArrayRef[2] dilation=1)
cname: SpatialDepthwiseConvolution
buffers: []
- name: _thnn_conv3d(Tensor self, Tensor weight, IntArrayRef[3] kernel_size, Tensor? bias={}, IntArrayRef[3] stride=1, IntArrayRef[3] padding=0)
cname: VolumetricConvolutionMM
buffers: [finput, fgrad_input]
CPU:
forward_scalar_types: ['Float', 'Double', 'Long']
backward_scalar_types: ['Float', 'Double']