convert_to_fp_of_same_size Class — pytorch Architecture
Architecture documentation for the convert_to_fp_of_same_size class in vec_base.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/cpu/vec/vec_base.h lines 1378–1392
template <typename T, typename IntType = int_same_size_t<T>>
inline Vectorized<T> convert_to_fp_of_same_size(
const Vectorized<IntType>& src) {
static_assert(sizeof(T) == sizeof(IntType));
static constexpr int size = Vectorized<T>::size();
std::array<IntType, size> src_arr;
src.store(static_cast<void*>(src_arr.data()));
std::array<T, size> buffer;
std::transform(
src_arr.cbegin(), src_arr.cend(), buffer.begin(), [](const IntType& x) {
return static_cast<T>(x);
});
return Vectorized<T>::loadu(static_cast<const void*>(buffer.data()));
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free