addCallback Class — pytorch Architecture
Architecture documentation for the addCallback class in ivalue_inl.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/core/ivalue_inl.h lines 1052–1065
template <typename T>
void addCallback(T callback, bool uses_future = true) {
static_assert(
std::is_invocable_r_v<void, T, Future&>,
"The callback must have signature void(Future&)");
std::unique_lock<std::mutex> lock(mutex_);
if (completed()) {
lock.unlock();
invokeCallback(callback, uses_future);
return;
}
callbacks_.emplace_back(std::move(callback), uses_future);
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free