Home / Class/ calc_i1 Class — pytorch Architecture

calc_i1 Class — pytorch Architecture

Architecture documentation for the calc_i1 class in Math.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/Math.h lines 1500–1514

template <typename T>
inline typename std::enable_if_t<std::is_floating_point_v<T>, T>
calc_i1(T _x) {
  T x = std::abs(_x);

  if (x <= T{8.0}) {
    auto [A, len] = chebyshev_coefficients_i1e_A<T>();
    T y = (x / T{2.0}) - T{2.0};
    const T out = std::exp(x) * x * chbevl(y, A, len);
    return (_x < T{0.0}) ? -out : out;
  }
  auto [B, len] = chebyshev_coefficients_i1e_B<T>();
  const T out = (std::exp(x) * chbevl(T{32.0} / x - T{2.0}, B, len)) / std::sqrt(x);
  return (_x < T{0.0}) ? -out : out;
}

Analyze Your Own Codebase

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

Try Supermodel Free