Home / Class/ safe_downcast Class — pytorch Architecture

safe_downcast Class — pytorch Architecture

Architecture documentation for the safe_downcast class in Pool.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/Pool.h lines 50–58

template <typename dest_t, typename src_t>
inline dest_t
safe_downcast(src_t v)
{
  TORCH_CHECK(std::numeric_limits<dest_t>::min() <= v && v <= std::numeric_limits<dest_t>::max(),
              "integer out of range");

  return static_cast<dest_t>(v);
}

Analyze Your Own Codebase

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

Try Supermodel Free