Func Class — pytorch Architecture
Architecture documentation for the Func class in LegacyBatchingRegistrations.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/functorch/LegacyBatchingRegistrations.cpp lines 487–497
template <typename F, F Func, typename... ExtraArgs>
Tensor unwrap_and_call(const Tensor& input, ExtraArgs... args) {
if (!participatesInCurrentLevel(input)) {
c10::impl::ExcludeDispatchKeyGuard guard(DispatchKey::FuncTorchBatched);
return Func(input, args...);
}
// guard against the user passing in a batch of scalar tensors with batch
auto* input_batched = unsafeGetBatchedImpl(input);
auto output_physical = Func(input_batched->value(), args...);
return makeBatched(output_physical, input_batched->bdim(), input_batched->level());
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free