Returns the size in bytes of a single element of the given dtype.
Parameters
dtDtypeDtype to query.
Returns
std::size_tElement size in bytes. 1 for Bool / I8, 2 for I16 / F16, 4 for I32 / F32, 8 for I64 / F64 / C64.
Raises
:logic_errorThe enum was extended without updating this switch.
Notes
constexpr so that nbytes = numel * dtype_size(dt) folds away at
compile time in kernel templates instantiated against a known dtype.