Home / Class/ sym_or Class — pytorch Architecture

sym_or Class — pytorch Architecture

Architecture documentation for the sym_or class in ConstantSymNodeImpl.cpp from the pytorch codebase.

Entity Profile

Source Code

c10/core/ConstantSymNodeImpl.cpp lines 44–57

template <typename T>
c10::SymNode ConstantSymNodeImpl<T>::sym_or(const c10::SymNode& other) {
  TORCH_INTERNAL_ASSERT(is_bool_(), "sym_or only works on bool");

  // If other is also a constant bool, compute the result directly
  if (auto other_const = other->constant_bool()) {
    bool result = this->bool_() || *other_const;
    return c10::make_intrusive<ConstantSymNodeImpl<bool>>(result);
  }

  // If other is a nested int or other symbolic type, defer to it
  return other->sym_or(
      c10::intrusive_ptr<ConstantSymNodeImpl<T>>::reclaim_copy(this));
}

Analyze Your Own Codebase

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

Try Supermodel Free