node

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Def

type Def struct {
	NodeDef *node_def_go_proto.NodeDef
}

func NewConstantNode

func NewConstantNode(name string, tensor *tf.Tensor) (*Def, error)

NewConstantNode creates a new const node based on a tensor

func NewNodeDef

func NewNodeDef(name, op string, attrValue *attr.Value, inputs ...string) (*Def, error)

NewNodeDef returns a new instance of Def using lower level raw inputs such as name and op as strings and attr values

func NewNodesFromTfOp

func NewNodesFromTfOp(operators ...func(scope *op.Scope)) ([]*Def, error)

NewNodesFromTfOp creates a graph using input operators and then extracts nodes from it. Please note that the operator signature only requires op.Scope as input, so it may be necessary to input closures. For instance, op.MatMul requires two tf.Output inputs

func NewPlaceholderNode

func NewPlaceholderNode(name string, dType tf.DataType) *Def

NewPlaceholderNode creates a new placeholder node for a given data type

func (*Def) GetAttr

func (g *Def) GetAttr(keys ...string) (*attr.Value, error)

GetAttr returns attr value for the input keys in a node

func (*Def) GetDevice

func (g *Def) GetDevice() string

GetDevice returns the device associated with the node

func (*Def) SetAttr

func (g *Def) SetAttr(attrValue *attr.Value)

SetAttr sets attr value for a node

func (*Def) SetDevice

func (g *Def) SetDevice(device string)

SetDevice sets the device for the node

Jump to

Keyboard shortcuts

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