MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ component_bytes()

size_t MayaFlux::IO::Detail::component_bytes ( Kakshya::TensorDType dtype)
nodiscardnoexcept

Bytes of one independently ordered component of an element.

A complex element is two components; every other element is one. Zero for sub-byte types, which have no byte order.

Definition at line 51 of file TensorCodec.cpp.

52{
53 const size_t bits = (dtype.kind == Kind::COMPLEX || dtype.kind == Kind::BCOMPLEX)
54 ? dtype.bits / 2U
55 : dtype.bits;
56 return bits % 8 == 0 ? bits / 8 : 0;
57}

Referenced by encode_npy(), MayaFlux::IO::NpyReader::read(), MayaFlux::IO::NpzReader::read(), MayaFlux::IO::RawTensorReader::read(), MayaFlux::IO::SafetensorsReader::read(), swap_components(), and MayaFlux::IO::SafetensorsWriter::write().

Here is the caller graph for this function: