binary_op_scalar Class — pytorch Architecture
Architecture documentation for the binary_op_scalar class in BinaryOpsKernel.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/cpu/BinaryOpsKernel.cpp lines 26–38
template <
typename scalar_t,
typename Op,
typename opmath_t = at::opmath_type<scalar_t>,
typename std::enable_if_t<is_reduced_floating_point_v<scalar_t>, int> = 0>
inline Vectorized<scalar_t> binary_op_scalar(
const Vectorized<scalar_t>& a,
opmath_t b,
const Op& op) {
Vectorized<opmath_t> vec_b(b);
auto [a0, a1] = convert_to_float<scalar_t>(a);
return convert_from_float<scalar_t>(op(a0, vec_b), op(a1, vec_b));
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free