onnx

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package onnx provides functionality to export Zerfoo models to ONNX format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter[T tensor.Numeric] struct {
}

Exporter provides functionality to export Zerfoo models to ONNX format.

func NewExporter

func NewExporter[T tensor.Numeric]() *Exporter[T]

NewExporter creates a new ONNX Exporter.

func (*Exporter[T]) ExportGraph

func (e *Exporter[T]) ExportGraph(_ *graph.Builder[T], _ interface{}) (*Model, error)

ExportGraph exports a Zerfoo computational graph to a simplified ONNX Model. This is a highly simplified example, only handling a single core.Dense layer. A full implementation would iterate through all nodes in a built graph, map each Zerfoo Node to its corresponding ONNX OpType, and handle all parameters.

type Initializer

type Initializer struct {
	Name  string
	Shape []int
	Data  interface{} // Raw tensor data
}

Initializer represents a simplified ONNX Initializer (model weights).

type Model

type Model struct {
	GraphName    string
	Inputs       []string
	Outputs      []string
	Nodes        []Node
	Initializers []Initializer
}

Model represents a simplified ONNX Model.

type Node

type Node struct {
	Name       string
	OpType     string
	Inputs     []string
	Outputs    []string
	Attributes map[string]interface{}
}

Node represents a simplified ONNX Node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL