Revision 3141686451b4439d0d6c5f6ee1789feec121fa5e authored by Gregory Chanan on 11 October 2016, 16:43:09 UTC, committed by Gregory Chanan on 08 November 2016, 21:01:05 UTC
Does as much math as possible in accreal to try to suss out why CudaHalfTensor fails.
1 parent e3d7d12
Raw File
Sigmoid.cu
#include "THCUNN.h"
#include "THCHalf.h"
#include "THCHalfAutoNumerics.cuh"

template <typename T>
struct sigmoidupdateOutput_functor
{
  __device__ void operator()(T *output, const T *input) const
  {
    *output = ScalarConvert<double, T>::to(1./(1.+ exp(-*input)));
  }
};

template <typename T>
struct sigmoidupdateGradInput_functor
{
  __device__ void operator()(T *gradInput, const T *output, const T *gradOutput) const
  {
    *gradInput = ScalarConvert<double, T>::to(*gradOutput * (1.-*output) * (*output));
  }
};

#include "generic/Sigmoid.cu"
#include "THCGenerateFloatTypes.h"
back to top