Documentation
¶
Index ¶
- Variables
- type Attribute
- func (*Attribute) Descriptor() ([]byte, []int)deprecated
- func (x *Attribute) GetF() float32
- func (x *Attribute) GetFloats() *Floats
- func (x *Attribute) GetI() int64
- func (x *Attribute) GetInts() *Ints
- func (x *Attribute) GetS() string
- func (x *Attribute) GetStrings() *Strings
- func (x *Attribute) GetValue() isAttribute_Value
- func (*Attribute) ProtoMessage()
- func (x *Attribute) ProtoReflect() protoreflect.Message
- func (x *Attribute) Reset()
- func (x *Attribute) String() string
- type Attribute_F
- type Attribute_Floats
- type Attribute_I
- type Attribute_Ints
- type Attribute_S
- type Attribute_Strings
- type Floats
- type Graph
- func (*Graph) Descriptor() ([]byte, []int)deprecated
- func (x *Graph) GetInputs() []*ValueInfo
- func (x *Graph) GetNodes() []*Node
- func (x *Graph) GetOutputs() []*ValueInfo
- func (x *Graph) GetParameters() map[string]*Tensor
- func (*Graph) ProtoMessage()
- func (x *Graph) ProtoReflect() protoreflect.Message
- func (x *Graph) Reset()
- func (x *Graph) String() string
- type Ints
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)deprecated
- func (x *Metadata) GetOpsetVersion() int64
- func (x *Metadata) GetProducerName() string
- func (x *Metadata) GetProducerVersion() string
- func (*Metadata) ProtoMessage()
- func (x *Metadata) ProtoReflect() protoreflect.Message
- func (x *Metadata) Reset()
- func (x *Metadata) String() string
- type Model
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetAttributes() map[string]*Attribute
- func (x *Node) GetInputs() []string
- func (x *Node) GetName() string
- func (x *Node) GetOpType() string
- func (x *Node) GetOutputs() []string
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- type Strings
- type Tensor
- func (*Tensor) Descriptor() ([]byte, []int)deprecated
- func (x *Tensor) GetData() []byte
- func (x *Tensor) GetDtype() Tensor_DataType
- func (x *Tensor) GetShape() []int64
- func (*Tensor) ProtoMessage()
- func (x *Tensor) ProtoReflect() protoreflect.Message
- func (x *Tensor) Reset()
- func (x *Tensor) String() string
- type Tensor_DataType
- func (Tensor_DataType) Descriptor() protoreflect.EnumDescriptor
- func (x Tensor_DataType) Enum() *Tensor_DataType
- func (Tensor_DataType) EnumDescriptor() ([]byte, []int)deprecated
- func (x Tensor_DataType) Number() protoreflect.EnumNumber
- func (x Tensor_DataType) String() string
- func (Tensor_DataType) Type() protoreflect.EnumType
- type ValueInfo
- func (*ValueInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ValueInfo) GetDtype() Tensor_DataType
- func (x *ValueInfo) GetName() string
- func (x *ValueInfo) GetShape() []int64
- func (*ValueInfo) ProtoMessage()
- func (x *ValueInfo) ProtoReflect() protoreflect.Message
- func (x *ValueInfo) Reset()
- func (x *ValueInfo) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Tensor_DataType_name = map[int32]string{ 0: "FLOAT32", 1: "FLOAT16", 2: "BFLOAT16", 3: "FLOAT8", 4: "INT32", 5: "INT64", 6: "FLOAT64", } Tensor_DataType_value = map[string]int32{ "FLOAT32": 0, "FLOAT16": 1, "BFLOAT16": 2, "FLOAT8": 3, "INT32": 4, "INT64": 5, "FLOAT64": 6, } )
Enum value maps for Tensor_DataType.
var File_zerfoo_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct {
// Types that are valid to be assigned to Value:
//
// *Attribute_F
// *Attribute_I
// *Attribute_S
// *Attribute_Floats
// *Attribute_Ints
// *Attribute_Strings
Value isAttribute_Value `protobuf_oneof:"value"`
// contains filtered or unexported fields
}
Attribute represents a named, non-tensor parameter for a node.
func (*Attribute) Descriptor
deprecated
func (*Attribute) GetStrings ¶
func (*Attribute) ProtoMessage ¶
func (*Attribute) ProtoMessage()
func (*Attribute) ProtoReflect ¶
func (x *Attribute) ProtoReflect() protoreflect.Message
type Attribute_F ¶
type Attribute_F struct {
F float32 `protobuf:"fixed32,1,opt,name=f,proto3,oneof"`
}
type Attribute_Floats ¶
type Attribute_Floats struct {
Floats *Floats `protobuf:"bytes,4,opt,name=floats,proto3,oneof"`
}
type Attribute_I ¶
type Attribute_I struct {
I int64 `protobuf:"varint,2,opt,name=i,proto3,oneof"`
}
type Attribute_Ints ¶
type Attribute_Ints struct {
Ints *Ints `protobuf:"bytes,5,opt,name=ints,proto3,oneof"`
}
type Attribute_S ¶
type Attribute_S struct {
S string `protobuf:"bytes,3,opt,name=s,proto3,oneof"`
}
type Attribute_Strings ¶
type Attribute_Strings struct {
Strings *Strings `protobuf:"bytes,6,opt,name=strings,proto3,oneof"`
}
type Floats ¶
type Floats struct {
Val []float32 `protobuf:"fixed32,1,rep,packed,name=val,proto3" json:"val,omitempty"`
// contains filtered or unexported fields
}
Wrapper messages for repeated primitive types in attributes.
func (*Floats) Descriptor
deprecated
func (*Floats) ProtoMessage ¶
func (*Floats) ProtoMessage()
func (*Floats) ProtoReflect ¶
func (x *Floats) ProtoReflect() protoreflect.Message
type Graph ¶
type Graph struct {
// A map of all trainable parameters (weights, biases) in the model.
// The key is a unique name for the parameter, e.g., "layers.0.attention.wq.weight".
Parameters map[string]*Tensor `` /* 147-byte string literal not displayed */
// A list of all nodes (layers or operations) in the graph.
// For sequential models, this list should be in execution order.
Nodes []*Node `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
// A list describing the input tensors to the graph.
Inputs []*ValueInfo `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
// A list describing the output tensors of the graph.
Outputs []*ValueInfo `protobuf:"bytes,4,rep,name=outputs,proto3" json:"outputs,omitempty"`
// contains filtered or unexported fields
}
Graph represents the computation graph of the model.
func (*Graph) Descriptor
deprecated
func (*Graph) GetOutputs ¶
func (*Graph) GetParameters ¶
func (*Graph) ProtoMessage ¶
func (*Graph) ProtoMessage()
func (*Graph) ProtoReflect ¶
func (x *Graph) ProtoReflect() protoreflect.Message
type Ints ¶
type Ints struct {
Val []int64 `protobuf:"varint,1,rep,packed,name=val,proto3" json:"val,omitempty"`
// contains filtered or unexported fields
}
func (*Ints) Descriptor
deprecated
func (*Ints) ProtoMessage ¶
func (*Ints) ProtoMessage()
func (*Ints) ProtoReflect ¶
func (x *Ints) ProtoReflect() protoreflect.Message
type Metadata ¶
type Metadata struct {
// The name of the tool or framework that produced this model.
ProducerName string `protobuf:"bytes,1,opt,name=producer_name,json=producerName,proto3" json:"producer_name,omitempty"`
// The version of the producer.
ProducerVersion string `protobuf:"bytes,2,opt,name=producer_version,json=producerVersion,proto3" json:"producer_version,omitempty"`
// The version of the ZMF operator set this model conforms to.
OpsetVersion int64 `protobuf:"varint,3,opt,name=opset_version,json=opsetVersion,proto3" json:"opset_version,omitempty"`
// contains filtered or unexported fields
}
Metadata stores information about the model's origin and versioning.
func (*Metadata) Descriptor
deprecated
func (*Metadata) GetOpsetVersion ¶
func (*Metadata) GetProducerName ¶
func (*Metadata) GetProducerVersion ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) ProtoReflect ¶
func (x *Metadata) ProtoReflect() protoreflect.Message
type Model ¶
type Model struct {
// The computation graph defining the model's architecture.
Graph *Graph `protobuf:"bytes,1,opt,name=graph,proto3" json:"graph,omitempty"`
// Metadata about the model, such as its producer.
Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
// contains filtered or unexported fields
}
Model is the top-level container for a serialized Zerfoo model.
func (*Model) Descriptor
deprecated
func (*Model) GetMetadata ¶
func (*Model) ProtoMessage ¶
func (*Model) ProtoMessage()
func (*Model) ProtoReflect ¶
func (x *Model) ProtoReflect() protoreflect.Message
type Node ¶
type Node struct {
// A unique name for this node, e.g., "transformer_block_0".
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The type of operation this node performs, e.g., "RMSNorm", "GlobalAttention".
// This must map to a registered constructor in the importer.
OpType string `protobuf:"bytes,2,opt,name=op_type,json=opType,proto3" json:"op_type,omitempty"`
// A list of names of the tensors that are inputs to this node.
// These can be names of parameters or outputs of other nodes.
Inputs []string `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
// A list of names for the output tensors of this node.
Outputs []string `protobuf:"bytes,4,rep,name=outputs,proto3" json:"outputs,omitempty"`
// A map of attributes for this node, for values that are not tensors.
// e.g., "epsilon" for RMSNorm, "hidden_dim" for FFN.
Attributes map[string]*Attribute `` /* 147-byte string literal not displayed */
// contains filtered or unexported fields
}
Node represents a single layer or operation in the computation graph.
func (*Node) Descriptor
deprecated
func (*Node) GetAttributes ¶
func (*Node) GetOutputs ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type Strings ¶
type Strings struct {
Val []string `protobuf:"bytes,1,rep,name=val,proto3" json:"val,omitempty"`
// contains filtered or unexported fields
}
func (*Strings) Descriptor
deprecated
func (*Strings) ProtoMessage ¶
func (*Strings) ProtoMessage()
func (*Strings) ProtoReflect ¶
func (x *Strings) ProtoReflect() protoreflect.Message
type Tensor ¶
type Tensor struct {
Dtype Tensor_DataType `protobuf:"varint,1,opt,name=dtype,proto3,enum=zmf.Tensor_DataType" json:"dtype,omitempty"`
// The shape (dimensions) of the tensor.
Shape []int64 `protobuf:"varint,2,rep,packed,name=shape,proto3" json:"shape,omitempty"`
// The raw tensor data, stored as bytes.
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
Tensor represents a multi-dimensional array of data (e.g., a weight matrix).
func (*Tensor) Descriptor
deprecated
func (*Tensor) GetDtype ¶
func (x *Tensor) GetDtype() Tensor_DataType
func (*Tensor) ProtoMessage ¶
func (*Tensor) ProtoMessage()
func (*Tensor) ProtoReflect ¶
func (x *Tensor) ProtoReflect() protoreflect.Message
type Tensor_DataType ¶
type Tensor_DataType int32
The data type of the tensor elements.
const ( Tensor_FLOAT32 Tensor_DataType = 0 Tensor_FLOAT16 Tensor_DataType = 1 Tensor_BFLOAT16 Tensor_DataType = 2 Tensor_FLOAT8 Tensor_DataType = 3 Tensor_INT32 Tensor_DataType = 4 Tensor_INT64 Tensor_DataType = 5 Tensor_FLOAT64 Tensor_DataType = 6 )
func (Tensor_DataType) Descriptor ¶
func (Tensor_DataType) Descriptor() protoreflect.EnumDescriptor
func (Tensor_DataType) Enum ¶
func (x Tensor_DataType) Enum() *Tensor_DataType
func (Tensor_DataType) EnumDescriptor
deprecated
func (Tensor_DataType) EnumDescriptor() ([]byte, []int)
Deprecated: Use Tensor_DataType.Descriptor instead.
func (Tensor_DataType) Number ¶
func (x Tensor_DataType) Number() protoreflect.EnumNumber
func (Tensor_DataType) String ¶
func (x Tensor_DataType) String() string
func (Tensor_DataType) Type ¶
func (Tensor_DataType) Type() protoreflect.EnumType
type ValueInfo ¶
type ValueInfo struct {
// The name of the tensor.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The data type of the tensor.
Dtype Tensor_DataType `protobuf:"varint,2,opt,name=dtype,proto3,enum=zmf.Tensor_DataType" json:"dtype,omitempty"`
// The shape of the tensor. A value of -1 can be used for dynamic dimensions.
Shape []int64 `protobuf:"varint,3,rep,packed,name=shape,proto3" json:"shape,omitempty"`
// contains filtered or unexported fields
}
ValueInfo describes a tensor, including its name, type, and shape.
func (*ValueInfo) Descriptor
deprecated
func (*ValueInfo) GetDtype ¶
func (x *ValueInfo) GetDtype() Tensor_DataType
func (*ValueInfo) ProtoMessage ¶
func (*ValueInfo) ProtoMessage()
func (*ValueInfo) ProtoReflect ¶
func (x *ValueInfo) ProtoReflect() protoreflect.Message