|
Mila
Deep Neural Network Library
|
Enumeration of built-in component types supported by the deserializer. More...
#include <string>#include <string_view>#include <cctype>Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Enumerations | |
| enum class | Mila::Dnn::ComponentType : int { Unknown = 0 , Linear , Gelu , Activation , Swiglu , LayerNorm , RmsNorm , Softmax , Dropout , MultiHeadAttention , GroupedQueryAttention , Residual , TokenEmbedding , Lpe , Rope , SoftmaxCrossEntropy , Mlp , GatedMlp , Transformer , Network , CustomComponentStart = 1000 , MockComponent = CustomComponentStart } |
| Canonical list of framework-known component types. More... | |
Functions | |
| ComponentType | Mila::Dnn::fromString (std::string_view s) noexcept |
| Parse a case-insensitive component name into a ComponentType. | |
| ComponentType | Mila::Dnn::fromTypeId (std::string_view s) noexcept |
| Map a short type identifier back to a ComponentType enum. | |
| std::string | Mila::Dnn::toString (ComponentType t) noexcept |
| Convert a ComponentType enum value to its canonical name. | |
| std::string | Mila::Dnn::toTypeId (ComponentType t) noexcept |
| Get the short 2..4 character type identifier for a ComponentType. | |
Enumeration of built-in component types supported by the deserializer.
Provides an enum and helper conversion utilities used by serialization, factories and concise diagnostics.
|
exportstrong |
Canonical list of framework-known component types.
These values are used by the deserializer and factory code to identify component implementations. Values 1..999 are reserved for built-in components; values >= CustomComponentStart are available for user defined components or extensions.
| Enumerator | |
|---|---|
| SoftmaxCrossEntropy | WIP: Fused softmax + cross-entropy loss – targeted for Llama training. |
| MockComponent | Example custom component for testing. |
|
inlineexportnoexcept |
Parse a case-insensitive component name into a ComponentType.
Accepts canonical names (case-insensitive) produced by toString and returns the corresponding enum value. Returns ComponentType::Unknown if the input does not match any known type.
| s | Input string (case-insensitive) |
|
inlineexportnoexcept |
Map a short type identifier back to a ComponentType enum.
Accepts the compact lowercase identifiers produced by toTypeId and returns the corresponding enum value. Returns ComponentType::Unknown for unrecognized identifiers.
| s | Short lowercase type id (for example "fc", "mlp", "tf") |
|
inlineexportnoexcept |
Convert a ComponentType enum value to its canonical name.
Returns a human-readable name suitable for logs and metadata fields (for example "Linear", "Transformer"). Always returns "Unknown" for unrecognized enum values.
| t | ComponentType enum value |
|
inlineexportnoexcept |
Get the short 2..4 character type identifier for a ComponentType.
The short type id is intended for compact labels in serialized metadata and concise diagnostics (examples: "fc" for Linear, "mlp" for MLP, "tf" for Transformer). Returns "Unknown" for unrecognized types.
| t | ComponentType enum value |