Documentation
¶
Index ¶
- func ErrInvalidShape(expected onnx.Shape, actual []int) error
- func ErrModel(format string, a ...any) error
- func ModelProtoFromBytes(bytesModel []byte) (*onnx.ModelProto, error)
- type InvalidShapeError
- type Model
- func (m *Model) InputDimSize(input string, i int) (int, error)
- func (m *Model) InputNames() []string
- func (m *Model) InputShapes() onnx.Shapes
- func (m *Model) OutputNames() []string
- func (m *Model) OutputShape(output string) onnx.Shape
- func (m *Model) OutputShapes() onnx.Shapes
- func (m *Model) ParamNames() []string
- func (m *Model) Run(inputs Tensors) (Tensors, error)
- type OpGetter
- type Tensors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrModel ¶
ErrModel is used for when an error ocured during setup of running onnx models. The user can specify a formatted message using the standard formatting rules.
func ModelProtoFromBytes ¶
func ModelProtoFromBytes(bytesModel []byte) (*onnx.ModelProto, error)
ModelProtoFromBytes creates an onnx.ModelProto based on a list of bytes.
Types ¶
type InvalidShapeError ¶
type InvalidShapeError struct {
// contains filtered or unexported fields
}
func (InvalidShapeError) Error ¶
func (i InvalidShapeError) Error() string
type Model ¶
type Model struct { GetOperator OpGetter // contains filtered or unexported fields }
Model defines a model that can be used for inference.
func NewModel ¶
func NewModel(mp *onnx.ModelProto) (*Model, error)
NewModel creates a new model ready for inference given a path to an onnx file.
func NewModelFromBytes ¶
NewModelFromBytes creates a new model from a list of bytes.
func NewModelFromFile ¶
NewModelFromFile creates a new model from a path to a file.
func NewModelFromZipFile ¶
NewModelFromZipFile creates a new model from a file in a zip archive.
func (*Model) InputDimSize ¶
InputDimSize returns the size of the input dimension given an input tensor.
func (*Model) InputNames ¶
InputNames returns this models input names as defined by the model proto.
func (*Model) InputShapes ¶
InputShapes returns the shapes for all input tensors.
func (*Model) OutputNames ¶
OutputNames returns this models output names as defined by the model proto.
func (*Model) OutputShape ¶
OutputShape returns the shape of a specific output tensors.
func (*Model) OutputShapes ¶
OutputShapes returns the shapes for all output tensors.
func (*Model) ParamNames ¶
ParamNames returns this models parameter names as defined by the model proto.
type OpGetter ¶
OpGetter is a function that gets an operator based on a string.
func ResolveOperatorGetter ¶
ResolveOperatorGetter resolves the getter for operators based on the opset version.
Directories
¶
Path | Synopsis |
---|---|
Package onnx provides wrapper functionality around the onnx.proto3.pb.go The goal is to provide a stable(ish) api around the proto file since the proto file is generated based on onnx.proto.
|
Package onnx provides wrapper functionality around the onnx.proto3.pb.go The goal is to provide a stable(ish) api around the proto file since the proto file is generated based on onnx.proto. |