Documentation
¶
Overview ¶
Package transpose provides the Transpose layer for the Zerfoo ML framework.
Index ¶
- func BuildTranspose[T tensor.Numeric](engine compute.Engine[T], _ numeric.Arithmetic[T], _ string, ...) (graph.Node[T], error)
- type Transpose
- func (t *Transpose[T]) Attributes() map[string]interface{}
- func (t *Transpose[T]) Backward(ctx context.Context, _ types.BackwardMode, ...) ([]*tensor.TensorNumeric[T], error)
- func (t *Transpose[T]) Forward(ctx context.Context, inputs ...*tensor.TensorNumeric[T]) (*tensor.TensorNumeric[T], error)
- func (t *Transpose[T]) OpType() string
- func (t *Transpose[T]) OutputShape() []int
- func (t *Transpose[T]) Parameters() []*graph.Parameter[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTranspose ¶
func BuildTranspose[T tensor.Numeric]( engine compute.Engine[T], _ numeric.Arithmetic[T], _ string, _ map[string]*graph.Parameter[T], attributes map[string]interface{}, ) (graph.Node[T], error)
BuildTranspose constructs a Transpose node, reading the permutation from attributes.
Types ¶
type Transpose ¶
Transpose represents a transpose operation.
func (*Transpose[T]) Attributes ¶
Attributes returns the attributes.
func (*Transpose[T]) Backward ¶
func (t *Transpose[T]) Backward(ctx context.Context, _ types.BackwardMode, outputGradient *tensor.TensorNumeric[T], _ ...*tensor.TensorNumeric[T]) ([]*tensor.TensorNumeric[T], error)
Backward computes the gradients for the Transpose layer.
func (*Transpose[T]) Forward ¶
func (t *Transpose[T]) Forward(ctx context.Context, inputs ...*tensor.TensorNumeric[T]) (*tensor.TensorNumeric[T], error)
Forward computes the transpose operation.
func (*Transpose[T]) OutputShape ¶
OutputShape returns the output shape of the Transpose layer.
func (*Transpose[T]) Parameters ¶
Parameters returns no trainable parameters for the Transpose layer.
Click to show internal directories.
Click to hide internal directories.