function_go_proto

package
v0.0.0-...-8fd67a1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0, BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_tensorflow_core_framework_function_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type FunctionDef

type FunctionDef struct {

	// The definition of the function's name, arguments, return values,
	// attrs etc.
	Signature *op_def_go_proto.OpDef `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
	// Attributes specific to this function definition.
	Attr    map[string]*attr_value_go_proto.AttrValue `` /* 149-byte string literal not displayed */
	ArgAttr map[uint32]*FunctionDef_ArgAttrs          `` /* 171-byte string literal not displayed */
	// Unique IDs for each resource argument, used to track aliasing resources. If
	// Argument A and Argument B alias each other, then
	// resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
	//
	// If this field is empty, none of the arguments could alias; otherwise, every
	// resource argument should have an entry in this field.
	//
	// When instantiated, the unique IDs will be attached to the _Arg nodes'
	// "_resource_arg_unique_id" attribute.
	ResourceArgUniqueId map[uint32]uint32 `` /* 212-byte string literal not displayed */
	// By convention, "op" in node_def is resolved by consulting with a
	// user-defined library first. If not resolved, "func" is assumed to
	// be a builtin op.
	NodeDef []*node_def_go_proto.NodeDef `protobuf:"bytes,3,rep,name=node_def,json=nodeDef,proto3" json:"node_def,omitempty"`
	// A mapping from the output arg names from `signature` to the
	// outputs from `node_def` that should be returned by the function.
	Ret map[string]string `` /* 147-byte string literal not displayed */
	// A mapping from control output names from `signature` to node names in
	// `node_def` which should be control outputs of this function.
	ControlRet map[string]string `` /* 179-byte string literal not displayed */
	// contains filtered or unexported fields
}

A function can be instantiated when the runtime can bind every attr with a value. When a GraphDef has a call to a function, it must have binding for every attr defined in the signature.

TODO(zhifengc):

  • device spec, etc.

func (*FunctionDef) Descriptor deprecated

func (*FunctionDef) Descriptor() ([]byte, []int)

Deprecated: Use FunctionDef.ProtoReflect.Descriptor instead.

func (*FunctionDef) GetArgAttr

func (x *FunctionDef) GetArgAttr() map[uint32]*FunctionDef_ArgAttrs

func (*FunctionDef) GetAttr

func (x *FunctionDef) GetAttr() map[string]*attr_value_go_proto.AttrValue

func (*FunctionDef) GetControlRet

func (x *FunctionDef) GetControlRet() map[string]string

func (*FunctionDef) GetNodeDef

func (x *FunctionDef) GetNodeDef() []*node_def_go_proto.NodeDef

func (*FunctionDef) GetResourceArgUniqueId

func (x *FunctionDef) GetResourceArgUniqueId() map[uint32]uint32

func (*FunctionDef) GetRet

func (x *FunctionDef) GetRet() map[string]string

func (*FunctionDef) GetSignature

func (x *FunctionDef) GetSignature() *op_def_go_proto.OpDef

func (*FunctionDef) ProtoMessage

func (*FunctionDef) ProtoMessage()

func (*FunctionDef) ProtoReflect

func (x *FunctionDef) ProtoReflect() protoreflect.Message

func (*FunctionDef) Reset

func (x *FunctionDef) Reset()

func (*FunctionDef) String

func (x *FunctionDef) String() string

type FunctionDefLibrary

type FunctionDefLibrary struct {
	Function            []*FunctionDef        `protobuf:"bytes,1,rep,name=function,proto3" json:"function,omitempty"`
	Gradient            []*GradientDef        `protobuf:"bytes,2,rep,name=gradient,proto3" json:"gradient,omitempty"`
	RegisteredGradients []*RegisteredGradient `protobuf:"bytes,3,rep,name=registered_gradients,json=registeredGradients,proto3" json:"registered_gradients,omitempty"`
	// contains filtered or unexported fields
}

A library is a set of named functions.

func (*FunctionDefLibrary) Descriptor deprecated

func (*FunctionDefLibrary) Descriptor() ([]byte, []int)

Deprecated: Use FunctionDefLibrary.ProtoReflect.Descriptor instead.

func (*FunctionDefLibrary) GetFunction

func (x *FunctionDefLibrary) GetFunction() []*FunctionDef

func (*FunctionDefLibrary) GetGradient

func (x *FunctionDefLibrary) GetGradient() []*GradientDef

func (*FunctionDefLibrary) GetRegisteredGradients

func (x *FunctionDefLibrary) GetRegisteredGradients() []*RegisteredGradient

func (*FunctionDefLibrary) ProtoMessage

func (*FunctionDefLibrary) ProtoMessage()

func (*FunctionDefLibrary) ProtoReflect

func (x *FunctionDefLibrary) ProtoReflect() protoreflect.Message

func (*FunctionDefLibrary) Reset

func (x *FunctionDefLibrary) Reset()

func (*FunctionDefLibrary) String

func (x *FunctionDefLibrary) String() string

type FunctionDef_ArgAttrs

type FunctionDef_ArgAttrs struct {
	Attr map[string]*attr_value_go_proto.AttrValue `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

Attributes for function arguments. These attributes are the same set of valid attributes as to _Arg nodes.

func (*FunctionDef_ArgAttrs) Descriptor deprecated

func (*FunctionDef_ArgAttrs) Descriptor() ([]byte, []int)

Deprecated: Use FunctionDef_ArgAttrs.ProtoReflect.Descriptor instead.

func (*FunctionDef_ArgAttrs) GetAttr

func (*FunctionDef_ArgAttrs) ProtoMessage

func (*FunctionDef_ArgAttrs) ProtoMessage()

func (*FunctionDef_ArgAttrs) ProtoReflect

func (x *FunctionDef_ArgAttrs) ProtoReflect() protoreflect.Message

func (*FunctionDef_ArgAttrs) Reset

func (x *FunctionDef_ArgAttrs) Reset()

func (*FunctionDef_ArgAttrs) String

func (x *FunctionDef_ArgAttrs) String() string

type GradientDef

type GradientDef struct {
	FunctionName string `protobuf:"bytes,1,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"` // The function name.
	GradientFunc string `protobuf:"bytes,2,opt,name=gradient_func,json=gradientFunc,proto3" json:"gradient_func,omitempty"` // The gradient function's name.
	// contains filtered or unexported fields
}

GradientDef defines the gradient function of a function defined in a function library.

A gradient function g (specified by gradient_func) for a function f (specified by function_name) must follow the following:

The function 'f' must be a numerical function which takes N inputs and produces M outputs. Its gradient function 'g', which is a function taking N + M inputs and produces N outputs.

I.e. if we have

(y1, y2, ..., y_M) = f(x1, x2, ..., x_N),

then, g is

(dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
                                  dL/dy1, dL/dy2, ..., dL/dy_M),

where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the loss function). dL/dx_i is the partial derivative of L with respect to x_i.

func (*GradientDef) Descriptor deprecated

func (*GradientDef) Descriptor() ([]byte, []int)

Deprecated: Use GradientDef.ProtoReflect.Descriptor instead.

func (*GradientDef) GetFunctionName

func (x *GradientDef) GetFunctionName() string

func (*GradientDef) GetGradientFunc

func (x *GradientDef) GetGradientFunc() string

func (*GradientDef) ProtoMessage

func (*GradientDef) ProtoMessage()

func (*GradientDef) ProtoReflect

func (x *GradientDef) ProtoReflect() protoreflect.Message

func (*GradientDef) Reset

func (x *GradientDef) Reset()

func (*GradientDef) String

func (x *GradientDef) String() string

type RegisteredGradient

type RegisteredGradient struct {
	GradientFunc     string `protobuf:"bytes,1,opt,name=gradient_func,json=gradientFunc,proto3" json:"gradient_func,omitempty"`               // The gradient function's name.
	RegisteredOpType string `protobuf:"bytes,2,opt,name=registered_op_type,json=registeredOpType,proto3" json:"registered_op_type,omitempty"` // The gradient function's registered op type.
	// contains filtered or unexported fields
}

RegisteredGradient stores a gradient function that is registered in the gradients library and used in the ops of a function in the function library. Unlike GradientDef, these gradients are identified by op type, and not directly linked to any function.

func (*RegisteredGradient) Descriptor deprecated

func (*RegisteredGradient) Descriptor() ([]byte, []int)

Deprecated: Use RegisteredGradient.ProtoReflect.Descriptor instead.

func (*RegisteredGradient) GetGradientFunc

func (x *RegisteredGradient) GetGradientFunc() string

func (*RegisteredGradient) GetRegisteredOpType

func (x *RegisteredGradient) GetRegisteredOpType() string

func (*RegisteredGradient) ProtoMessage

func (*RegisteredGradient) ProtoMessage()

func (*RegisteredGradient) ProtoReflect

func (x *RegisteredGradient) ProtoReflect() protoreflect.Message

func (*RegisteredGradient) Reset

func (x *RegisteredGradient) Reset()

func (*RegisteredGradient) String

func (x *RegisteredGradient) String() string

Jump to

Keyboard shortcuts

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