Home / Class/ get_scalar_elu_elementwise_func Class — pytorch Architecture

get_scalar_elu_elementwise_func Class — pytorch Architecture

Architecture documentation for the get_scalar_elu_elementwise_func class in Elu.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/cpu/Elu.h lines 22–32

template <typename ParamT, typename MathT=ParamT>
auto get_scalar_elu_elementwise_func(MathT alpha, MathT scale, MathT input_scale) {
  const auto negcoef = alpha * scale;
  const auto poscoef = scale;
  const auto negiptcoef = input_scale;
  return [negcoef, negiptcoef, poscoef](ParamT a) -> ParamT {
    return MathT(a) < MathT(0)
      ? std::expm1(MathT(a) * negiptcoef) * negcoef
      : MathT(a) * poscoef;
  };
}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free