storage_size_for Class — pytorch Architecture
Architecture documentation for the storage_size_for class in ResizeCommon.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/ResizeCommon.h lines 16–30
template <typename T>
inline T storage_size_for(ArrayRef<T> size, ArrayRef<T> stride) {
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(size.size() == stride.size(),
"storage_size_for(size, stride) requires that size and stride ",
"have the same size as a precondition.");
T storage_size = 1;
for (const auto dim : c10::irange(size.size())) {
if (size[dim] == 0) {
storage_size = 0;
break;
}
storage_size += (size[dim] - 1) * stride[dim];
}
return storage_size;
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free