1 #ifndef TH_GENERIC_FILE 2 #define TH_GENERIC_FILE "THNN/generic/THNN.h" 5 #include <ATen/core/Reduction.h> 7 TH_API
void THNN_(AbsCriterion_updateOutput)(
13 TH_API
void THNN_(AbsCriterion_updateGradInput)(
21 TH_API
void THNN_(BCECriterion_updateOutput)(
28 TH_API
void THNN_(BCECriterion_updateGradInput)(
37 TH_API
void THNN_(ClassNLLCriterion_updateOutput)(
40 THIndexTensor *target,
44 THTensor *total_weight,
45 int64_t ignore_index);
46 TH_API
void THNN_(ClassNLLCriterion_updateGradInput)(
49 THIndexTensor *target,
54 THTensor *total_weight,
55 int64_t ignore_index);
57 TH_API
void THNN_(ELU_updateOutput)(
65 TH_API
void THNN_(ELU_updateGradInput)(
74 TH_API
void THNN_(GatedLinear_updateOutput)(
79 TH_API
void THNN_(GatedLinear_updateGradInput)(
87 TH_API
void THNN_(HardTanh_updateOutput)(
94 TH_API
void THNN_(HardTanh_updateGradInput)(
103 TH_API
void THNN_(Im2Col_updateOutput)(
107 int64_t kH, int64_t kW,
108 int64_t dilationH, int64_t dilationW,
109 int64_t padH, int64_t padW,
110 int64_t dH, int64_t dW);
112 TH_API
void THNN_(Im2Col_updateGradInput)(
114 THTensor *gradOutput,
116 int64_t isizeH, int64_t isizeW,
117 int64_t kH, int64_t kW,
118 int64_t dilationH, int64_t dilationW,
119 int64_t padH, int64_t padW,
120 int64_t dH, int64_t dW);
122 TH_API
void THNN_(Col2Im_updateOutput)(
126 int64_t outputHeight, int64_t outputWidth,
127 int64_t kH, int64_t kW,
128 int64_t dilationH, int64_t dilationW,
129 int64_t padH, int64_t padW,
130 int64_t dH, int64_t dW);
132 TH_API
void THNN_(Col2Im_updateGradInput)(
134 THTensor *gradOutput,
136 int64_t kH, int64_t kW,
137 int64_t dilationH, int64_t dilationW,
138 int64_t padH, int64_t padW,
139 int64_t dH, int64_t dW);
141 TH_API
void THNN_(LeakyReLU_updateOutput)(
147 TH_API
void THNN_(LeakyReLU_updateGradInput)(
150 THTensor *gradOutput,
155 TH_API
void THNN_(LogSigmoid_updateOutput)(
160 TH_API
void THNN_(LogSigmoid_updateGradInput)(
163 THTensor *gradOutput,
167 TH_API
void THNN_(SoftMarginCriterion_updateOutput)(
174 TH_API
void THNN_(SoftMarginCriterion_updateGradInput)(
178 THTensor *gradOutput,
182 TH_API
void THNN_(MSECriterion_updateOutput)(
188 TH_API
void THNN_(MSECriterion_updateGradInput)(
192 THTensor *gradOutput,
196 TH_API
void THNN_(MultiLabelMarginCriterion_updateOutput)(
199 THIndexTensor *target,
203 TH_API
void THNN_(MultiLabelMarginCriterion_updateGradInput)(
206 THIndexTensor *target,
207 THTensor *gradOutput,
212 TH_API
void THNN_(MultiMarginCriterion_updateOutput)(
215 THIndexTensor *target,
221 TH_API
void THNN_(MultiMarginCriterion_updateGradInput)(
224 THIndexTensor *target,
225 THTensor *gradOutput,
232 TH_API
void THNN_(RReLU_updateOutput)(
241 THGenerator *generator);
242 TH_API
void THNN_(RReLU_updateGradInput)(
245 THTensor *gradOutput,
253 TH_API
void THNN_(Sigmoid_updateOutput)(
257 TH_API
void THNN_(Sigmoid_updateGradInput)(
259 THTensor *gradOutput,
263 TH_API
void THNN_(SmoothL1Criterion_updateOutput)(
269 TH_API
void THNN_(SmoothL1Criterion_updateGradInput)(
273 THTensor *gradOutput,
277 TH_API
void THNN_(SoftPlus_updateOutput)(
279 THTensor *input, THTensor *output,
282 TH_API
void THNN_(SoftPlus_updateGradInput)(
285 THTensor *gradOutput,
291 TH_API
void THNN_(SoftShrink_updateOutput)(
296 TH_API
void THNN_(SoftShrink_updateGradInput)(
299 THTensor *gradOutput,
304 TH_API
void THNN_(IndexLinear_updateOutput)(
309 THIndexTensor *sizes,
310 THIndexTensor *cumSumSizes,
314 THTensor *normalizedValues,
316 TH_API
void THNN_(IndexLinear_accGradParameters)(
321 THIndexTensor *sizes,
322 THIndexTensor *cumSumSizes,
323 THTensor *gradOutput,
324 THTensor *gradWeight,
328 THTensor* valuesBuffer,
331 TH_API
void THNN_(IndexLinear_accUpdateGradParameters)(
336 THIndexTensor *sizes,
337 THIndexTensor *cumSumSizes,
338 THTensor *gradOutput,
343 TH_API
void THNN_(IndexLinear_updateParameters)(
345 THTensor *gradWeight,
349 THIndexTensor *runningKeys,
350 THIndexTensor *cumSumSizes,
353 accreal learningRate);
355 TH_API
void THNN_(TemporalRowConvolution_updateOutput)(
362 THTensor *fgradInput,
367 TH_API
void THNN_(TemporalRowConvolution_updateGradInput)(
370 THTensor *gradOutput,
374 THTensor *fgradInput,
379 TH_API
void THNN_(TemporalRowConvolution_accGradParameters)(
382 THTensor *gradOutput,
383 THTensor *gradWeight,
386 THTensor *fgradInput,
393 TH_API
void THNN_(TemporalUpSamplingNearest_updateOutput)(
398 TH_API
void THNN_(TemporalUpSamplingNearest_updateGradInput)(
400 THTensor *gradOutput,
407 TH_API
void THNN_(TemporalUpSamplingLinear_updateOutput)(
413 TH_API
void THNN_(TemporalUpSamplingLinear_updateGradInput)(
415 THTensor *gradOutput,
423 TH_API
void THNN_(SpatialConvolutionMM_updateOutput)(
430 THTensor *fgradInput,
434 TH_API
void THNN_(SpatialConvolutionMM_updateGradInput)(
437 THTensor *gradOutput,
441 THTensor *fgradInput,
445 TH_API
void THNN_(SpatialConvolutionMM_accGradParameters)(
448 THTensor *gradOutput,
449 THTensor *gradWeight,
452 THTensor *fgradInput,
458 TH_API
void THNN_(SpatialAdaptiveMaxPooling_updateOutput)(
462 THIndexTensor *indices,
463 int osizeW,
int osizeH);
464 TH_API
void THNN_(SpatialAdaptiveMaxPooling_updateGradInput)(
467 THTensor *gradOutput,
469 THIndexTensor *indices);
471 TH_API
void THNN_(SpatialAveragePooling_updateOutput)(
479 bool count_include_pad);
480 TH_API
void THNN_(SpatialAveragePooling_updateGradInput)(
483 THTensor *gradOutput,
489 bool count_include_pad);
491 TH_API
void THNN_(SpatialDilatedConvolution_updateOutput)(
502 int dilationW,
int dilationH);
504 TH_API
void THNN_(SpatialDilatedConvolution_updateGradInput)(
507 THTensor *gradOutput,
514 int dilationW,
int dilationH);
516 TH_API
void THNN_(SpatialDilatedConvolution_accGradParameters)(
519 THTensor *gradOutput,
520 THTensor *gradWeight,
527 int dilationW,
int dilationH,
530 TH_API
void THNN_(SpatialFullDilatedConvolution_updateOutput)(
541 int dilationW,
int dilationH,
544 TH_API
void THNN_(SpatialFullDilatedConvolution_updateGradInput)(
547 THTensor *gradOutput,
554 int dilationW,
int dilationH,
557 TH_API
void THNN_(SpatialFullDilatedConvolution_accGradParameters)(
560 THTensor *gradOutput,
561 THTensor *gradWeight,
568 int dilationW,
int dilationH,
572 TH_API
void THNN_(SpatialDilatedMaxPooling_updateOutput)(
576 THIndexTensor *indices,
580 int dilationW,
int dilationH,
582 TH_API
void THNN_(SpatialDilatedMaxPooling_updateGradInput)(
585 THTensor *gradOutput,
587 THIndexTensor *indices,
591 int dilationW,
int dilationH,
594 TH_API
void THNN_(SpatialMaxUnpooling_updateOutput)(
598 THIndexTensor *indices,
599 int owidth,
int oheight);
600 TH_API
void THNN_(SpatialMaxUnpooling_updateGradInput)(
603 THTensor *gradOutput,
605 THIndexTensor *indices,
606 int owidth,
int oheight);
608 TH_API
void THNN_(SpatialUpSamplingNearest_updateOutput)(
615 TH_API
void THNN_(SpatialUpSamplingNearest_updateGradInput)(
617 THTensor *gradOutput,
626 TH_API
void THNN_(SpatialUpSamplingBilinear_updateOutput)(
634 TH_API
void THNN_(SpatialUpSamplingBilinear_updateGradInput)(
636 THTensor *gradOutput,
646 TH_API
void THNN_(SpatialUpSamplingBicubic_updateOutput)(
654 TH_API
void THNN_(SpatialUpSamplingBicubic_updateGradInput)(
656 THTensor *gradOutput,
666 TH_API
void THNN_(unfolded_acc)(
673 int inputWidth,
int inputHeight,
674 int osizeW,
int outputHeight);
675 TH_API
void THNN_(unfolded_copy)(
682 int inputWidth,
int inputHeight,
683 int outputWidth,
int outputHeight);
685 TH_API
void THNN_(VolumetricAveragePooling_updateOutput)(
689 int kT,
int kW,
int kH,
690 int dT,
int dW,
int dH,
691 int padT,
int padW,
int padH,
692 bool ceil_mode,
bool count_include_pad);
693 TH_API
void THNN_(VolumetricAveragePooling_updateGradInput)(
696 THTensor *gradOutput,
698 int kT,
int kW,
int kH,
699 int dT,
int dW,
int dH,
700 int padT,
int padW,
int padH,
701 bool ceil_mode,
bool count_include_pad);
703 TH_API
void THNN_(VolumetricDilatedConvolution_updateOutput)(
711 int kT,
int kW,
int kH,
712 int dT,
int dW,
int dH,
713 int padT,
int padW,
int padH,
714 int dilationT,
int dilationW,
int dilationH);
716 TH_API
void THNN_(VolumetricDilatedConvolution_updateGradInput)(
719 THTensor *gradOutput,
723 int kT,
int kW,
int kH,
724 int dT,
int dW,
int dH,
725 int padT,
int padW,
int padH,
726 int dilationT,
int dilationW,
int dilationH);
728 TH_API
void THNN_(VolumetricDilatedConvolution_accGradParameters)(
731 THTensor *gradOutput,
732 THTensor *gradWeight,
736 int kT,
int kW,
int kH,
737 int dT,
int dW,
int dH,
738 int padT,
int padW,
int padH,
739 int dilationT,
int dilationW,
int dilationH,
742 TH_API
void THNN_(VolumetricFullDilatedConvolution_updateOutput)(
749 THTensor *fgradInput,
750 int kT,
int kW,
int kH,
751 int dT,
int dW,
int dH,
752 int pT,
int pW,
int pH,
753 int dilationT,
int dilationW,
int dilationH,
754 int aT,
int aW,
int aH);
755 TH_API
void THNN_(VolumetricFullDilatedConvolution_updateGradInput)(
758 THTensor *gradOutput,
762 THTensor *fgradInput,
763 int kT,
int kW,
int kH,
764 int dT,
int dW,
int dH,
765 int pT,
int pW,
int pH,
766 int dilationT,
int dilationW,
int dilationH,
767 int aT,
int aW,
int aH);
769 TH_API
void THNN_(VolumetricFullDilatedConvolution_accGradParameters)(
772 THTensor *gradOutput,
773 THTensor *gradWeight,
776 THTensor *fgradInput,
777 int kT,
int kW,
int kH,
778 int dT,
int dW,
int dH,
779 int pT,
int pW,
int pH,
780 int dilationT,
int dilationW,
int dilationH,
781 int aT,
int aW,
int aH,
784 TH_API
void THNN_(VolumetricDilatedMaxPooling_updateOutput)(
788 THIndexTensor *indices,
789 int kT,
int kW,
int kH,
790 int dT,
int dW,
int dH,
791 int pT,
int pW,
int pH,
792 int dilationT,
int dilationW,
int dilationH,
794 TH_API
void THNN_(VolumetricDilatedMaxPooling_updateGradInput)(
797 THTensor *gradOutput,
799 THIndexTensor *indices,
800 int kT,
int kW,
int kH,
801 int dT,
int dW,
int dH,
802 int pT,
int pW,
int pH,
803 int dilationT,
int dilationW,
int dilationH,
806 TH_API
void THNN_(VolumetricMaxUnpooling_updateOutput)(
810 THIndexTensor *indices,
811 int oT,
int oW,
int oH,
812 int dT,
int dW,
int dH,
813 int pT,
int pW,
int pH);
814 TH_API
void THNN_(VolumetricMaxUnpooling_updateGradInput)(
817 THTensor *gradOutput,
819 THIndexTensor *indices,
820 int oT,
int oW,
int oH,
821 int dT,
int dW,
int dH,
822 int pT,
int pW,
int pH);
824 TH_API
void THNN_(VolumetricAdaptiveAveragePooling_updateOutput)(
831 TH_API
void THNN_(VolumetricAdaptiveAveragePooling_updateGradInput)(
834 THTensor *gradOutput,
835 THTensor *gradInput);
837 TH_API
void THNN_(VolumetricAdaptiveMaxPooling_updateOutput)(
841 THIndexTensor *indices,
842 int osizeT,
int osizeW,
int osizeH);
843 TH_API
void THNN_(VolumetricAdaptiveMaxPooling_updateGradInput)(
846 THTensor *gradOutput,
848 THIndexTensor *indices);
850 TH_API
void THNN_(FeatureLPPooling_updateOutput)(
859 TH_API
void THNN_(FeatureLPPooling_updateGradInput)(
861 THTensor* gradOutput,
870 TH_API
void THNN_(VolumetricUpSamplingNearest_updateOutput)(
878 TH_API
void THNN_(VolumetricUpSamplingNearest_updateGradInput)(
880 THTensor *gradOutput,
891 TH_API
void THNN_(VolumetricUpSamplingTrilinear_updateOutput)(
900 TH_API
void THNN_(VolumetricUpSamplingTrilinear_updateGradInput)(
902 THTensor *gradOutput,
914 TH_API
void THNN_(Tanh_updateOutput)(
918 TH_API
void THNN_(Tanh_updateGradInput)(
920 THTensor *gradOutput,
924 TH_API
void THNN_(VolumetricConvolutionMM_updateOutput)(
931 THTensor *fgradInput,
932 int kT,
int kW,
int kH,
933 int dT,
int dW,
int dH,
934 int pT,
int pW,
int pH);
935 TH_API
void THNN_(VolumetricConvolutionMM_updateGradInput)(
938 THTensor *gradOutput,
942 THTensor *fgradInput,
943 int kT,
int kW,
int kH,
944 int dT,
int dW,
int dH,
945 int pT,
int pW,
int pH);
946 TH_API
void THNN_(VolumetricConvolutionMM_accGradParameters)(
949 THTensor *gradOutput,
950 THTensor *gradWeight,
953 THTensor *fgradInput,
954 int kT,
int kW,
int kH,
955 int dT,
int dW,
int dH,
956 int pT,
int pW,
int pH,
959 TH_API
void THNN_(SpatialClassNLLCriterion_updateOutput)(
962 THIndexTensor *target,
966 THTensor *total_weight,
967 int64_t ignore_index);
969 TH_API
void THNN_(SpatialClassNLLCriterion_updateGradInput)(
972 THIndexTensor *target,
973 THTensor *gradOutput,
977 THTensor *total_weight,
978 int64_t ignore_index);