fill_non_native_type Class — pytorch Architecture
Architecture documentation for the fill_non_native_type class in FillKernel.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/cpu/FillKernel.cpp lines 16–26
template <typename scalar_t>
void fill_non_native_type(TensorIterator& iter, const Scalar& value_scalar) {
auto value = value_scalar.to<scalar_t>().x;
using H = typename std::make_signed_t<decltype(value)>; // Signed type has more acceleration
// Reserve the representation of value. static_cast<H>(value) is implementation defined.
H val = *reinterpret_cast<H*>(std::addressof(value));
cpu_kernel_vec</*check_dynamic_cast=*/false>(
iter,
[val]() -> H { return val; },
[val]() { return Vectorized<H>(val); });
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free