Home / Class/ is_reduced_floating_point_v Class — pytorch Architecture

is_reduced_floating_point_v Class — pytorch Architecture

Architecture documentation for the is_reduced_floating_point_v class in UpSampleMoreKernel.cpp from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/cpu/UpSampleMoreKernel.cpp lines 17–32

template <typename acc_t, typename scalar_t,
          typename scalar_nonconst_t = std::remove_const_t<scalar_t>,
          typename std::enable_if_t<!is_reduced_floating_point_v<scalar_nonconst_t> || !std::is_same_v<acc_t, float>, int> = 0>
void inline nearest_channels_last_acc(acc_t* gin, scalar_t* gout, int64_t size) {
  static_assert(std::is_same_v<acc_t, scalar_nonconst_t>,
              "acc data type of Upsample backward should be same as scalar_t for float or double on CPU.");
  using Vec = Vectorized<acc_t>;
  int64_t d = 0;
  for (; d < size - (size % Vec::size()); d += Vec::size()) {
    Vec gin_vec = Vec::loadu(gin + d) + Vec::loadu(gout + d);
    gin_vec.store(gin + d);
  }
  for (; d < size; d++) {
    gin[d] += gout[d];
  }
}

Analyze Your Own Codebase

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

Try Supermodel Free