toIntrusivePtr Class — pytorch Architecture
Architecture documentation for the toIntrusivePtr class in ivalue_inl.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/core/ivalue_inl.h lines 72–80
template <typename T, class NullType>
c10::intrusive_ptr<T, NullType> IValue::toIntrusivePtr() const {
if (payload.u.as_intrusive_ptr == c10::UndefinedTensorImpl::singleton()) {
return c10::intrusive_ptr<T, NullType>();
}
c10::raw::intrusive_ptr::incref(payload.u.as_intrusive_ptr);
return c10::intrusive_ptr<T, NullType>::reclaim(
static_cast<T*>(payload.u.as_intrusive_ptr));
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free