Home / Class/ uniform_real Class — pytorch Architecture

uniform_real Class — pytorch Architecture

Architecture documentation for the uniform_real class in TransformationHelper.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/core/TransformationHelper.h lines 83–89

template <typename T, typename V>
C10_HOST_DEVICE inline dist_acctype<T> uniform_real(V val, T from, T to) {
  constexpr auto MASK = static_cast<V>((static_cast<uint64_t>(1) << std::numeric_limits<T>::digits) - 1);
  constexpr auto DIVISOR = static_cast<dist_acctype<T>>(1) / (static_cast<uint64_t>(1) << std::numeric_limits<T>::digits);
  dist_acctype<T> x = (val & MASK) * DIVISOR;
  return (x * (to - from) + from);
}

Analyze Your Own Codebase

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

Try Supermodel Free