forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnn.yaml
206 lines (169 loc) · 7.02 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# 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'
- 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'
- 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'
# Pooling
- name: _thnn_avg_pool2d(Tensor self, IntArrayRef[2] kernel_size, IntArrayRef[2] stride={}, IntArrayRef[2] padding=0, bool ceil_mode=false, bool count_include_pad=true)
cname: SpatialAveragePooling
default_init:
stride: kernel_size
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_avg_pool3d(Tensor self, IntArrayRef[3] kernel_size, IntArrayRef[3] stride={}, IntArrayRef[3] padding=0, bool ceil_mode=false, bool count_include_pad=true)
cname: VolumetricAveragePooling
default_init:
stride: kernel_size
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_max_unpool2d(Tensor self, LongTensor indices, IntArrayRef[2] output_size)
cname: SpatialMaxUnpooling
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_max_unpool3d(Tensor self, LongTensor indices, IntArrayRef[3] output_size, IntArrayRef[3] stride, IntArrayRef[3] padding)
cname: VolumetricMaxUnpooling
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_conv_transpose2d(Tensor self, Tensor weight, IntArrayRef[2] kernel_size, Tensor? bias={}, IntArrayRef[2] stride=1, IntArrayRef[2] padding=0, IntArrayRef[2] output_padding=0, IntArrayRef[2] dilation=1)
cname: SpatialFullDilatedConvolution
buffers: [columns, ones]
- name: _thnn_conv_transpose3d(Tensor self, Tensor weight, IntArrayRef[3] kernel_size, Tensor? bias={}, IntArrayRef[3] stride=1, IntArrayRef[3] padding=0, IntArrayRef[3] output_padding=0, IntArrayRef[3] dilation=1)
cname: VolumetricFullDilatedConvolution
buffers: [finput, fgrad_input]
- 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]
- 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]
- name: _thnn_conv_dilated2d(Tensor self, Tensor weight, IntArrayRef[2] kernel_size, Tensor? bias={}, IntArrayRef[2] stride=1, IntArrayRef[2] padding=0, IntArrayRef[2] dilation=1)
cname: SpatialDilatedConvolution
buffers: [columns, ones]
- name: _thnn_conv_dilated3d(Tensor self, Tensor weight, IntArrayRef[3] kernel_size, Tensor? bias={}, IntArrayRef[3] stride=1, IntArrayRef[3] padding=0, IntArrayRef[3] dilation=1)
cname: VolumetricDilatedConvolution
buffers: [columns, ones]
# Fold and Unfold
- name: _thnn_col2im(Tensor self, IntArrayRef[2] output_size, IntArrayRef[2] kernel_size, IntArrayRef[2] dilation, IntArrayRef[2] padding, IntArrayRef[2] stride)
cname: Col2Im
scalar_check:
output: 'false'
grad_input: 'false'
- name: _thnn_im2col(Tensor self, IntArrayRef[2] kernel_size, IntArrayRef[2] dilation, IntArrayRef[2] padding, IntArrayRef[2] stride)
cname: Im2Col
scalar_check:
output: 'false'
grad_input: 'false'