Home / Class/ check_generator Class — pytorch Architecture

check_generator Class — pytorch Architecture

Architecture documentation for the check_generator class in Generator.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/core/Generator.h lines 150–156

template <typename T>
inline T * check_generator(std::optional<Generator> gen) {
  TORCH_CHECK(gen.has_value(), "Expected Generator but received nullopt");
  TORCH_CHECK(gen->defined(), "Generator with undefined implementation is not allowed");
  TORCH_CHECK(T::device_type() == gen->device().type(), "Expected a '", T::device_type(), "' device type for generator but found '", gen->device().type(), "'");
  return gen->get<T>();
}

Analyze Your Own Codebase

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

Try Supermodel Free