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
|
#ifndef THC_GENERIC_FILE
#define THC_GENERIC_FILE "generic/SoftPlus.cu"
#else
#include "../common.h"
void THNN_(SoftPlus_updateOutput)(
THCState *state,
THCTensor *input,
THCTensor *output,
real beta,
real threshold)
{
THCUNN_assertSameGPU_generic(state, 2, input, output);
THCTensor_(resizeAs)(state, output, input);
THC_pointwiseApply2(state, output, input, softPlusupdateOutput_functor<real>(threshold, beta));
}
void THNN_(SoftPlus_updateGradInput)(
THCState *state,
THCTensor *input,
THCTensor *gradOutput,
THCTensor *gradInput,
THCTensor *output,
real beta,
real threshold)
{
THCUNN_assertSameGPU_generic(state, 4, input, output, gradOutput, gradInput);
THCTensor_(resizeAs)(state, gradInput, output);
THC_pointwiseApply3(state, gradInput, output, gradOutput, softPlusupdateGradInput_functor<real>(threshold, beta));
}
#endif
|