text: #ifndef TH_GENERIC_FILE
  #define TH_GENERIC_FILE "THNN/generic/Sigmoid.c"
  #else
  
  void THNN_(Sigmoid_updateOutput)(
            THNNState *state,
            THTensor *input,
            THTensor *output)
  {
    THTensor_(sigmoid)(output, input);
  }
  
  void THNN_(Sigmoid_updateGradInput)(
            THNNState *state,
            THTensor *gradOutput,
            THTensor *gradInput,
            THTensor *output)
  {
    THNN_CHECK_NELEMENT(output, gradOutput);
    THTensor_(resizeAs)(gradInput, output);
    TH_TENSOR_APPLY3(scalar_t, gradInput, scalar_t, gradOutput, scalar_t, output,
      scalar_t z = *output_data;
      *gradInput_data = *gradOutput_data * (1. - z) * z;
    );
  }
  
  #endif
  