Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Quant::Weight::WeightQuantPolicy Concept Referenceexport

Concept definition

template<typename T>
concept WeightQuantPolicy = requires
{
{ T::kIsQuantized } -> std::convertible_to<bool>;
{
T::kStorageDtype
} -> std::convertible_to<TensorDataType>;
{
T::kScaleDtype
} -> std::convertible_to<TensorDataType>;
{
T::kPerChannel
} -> std::convertible_to<bool>;
// Bits of the PRIMARY weight tensor per logical element -- what Linear needs to
// size the packed allocation. It states the fact the allocation used to infer from
// kPerChannel, which only ever meant "nibble-packed" because every per-group policy
// happened to be 4-bit. A policy whose format spills into a companion plane counts
// only the primary tensor here; the companion carries its own extent.
{
T::kStorageBitsPerElement
} -> std::convertible_to<int>;
}