Home / Class/ nargs Class — pytorch Architecture

nargs Class — pytorch Architecture

Architecture documentation for the nargs class in TensorIteratorDynamicCasting.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/TensorIteratorDynamicCasting.h lines 22–34

template <typename func_t, int nargs = function_traits<func_t>::arity>
struct needs_dynamic_casting {
  static bool check(TensorIteratorBase& iter) {
    using traits = function_traits<func_t>;
    using cpp_type = typename traits::template arg<nargs - 1>::type;
    using cpp_map = c10::CppTypeToScalarType<cpp_type>;

    if (iter.input_dtype(nargs - 1) != cpp_map::value) {
      return true;
    }
    return needs_dynamic_casting<func_t, nargs - 1>::check(iter);
  }
};

Analyze Your Own Codebase

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

Try Supermodel Free