ATen icon indicating copy to clipboard operation
ATen copied to clipboard

Multiple definitions of tanh (TH and THNN)

Open ezyang opened this issue 6 years ago • 0 comments

At the moment, we seem to have multiple definitions of tanh. From Declarations:

[[
  name: tanh
  types:
    - floating_point
  backends:
    - CPU
    - CUDA
  variants:
    - method
    - function
  return: argument 0
  arguments:
    - arg: THTensor* result
      output: True
    - THTensor* self
]]

and from nn


TH_API void THNN_(Tanh_updateOutput)(
          THNNState *state,
          THTensor *input,
          THTensor *output);
TH_API void THNN_(Tanh_updateGradInput)(
          THNNState *state,
          THTensor *gradOutput,
          THTensor *gradInput,
          THTensor *output);

This seems highly questionable. At the moment, the non-NN definition wins and the NN definition is relegated to the method name _tanh (at the time of writing, I have no idea where this actually happens). Is this actually by design? Where is this explained?

ezyang avatar Nov 09 '17 08:11 ezyang