framework

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DataType_name = map[int32]string{
		0:   "DT_INVALID",
		1:   "DT_FLOAT",
		2:   "DT_DOUBLE",
		3:   "DT_INT32",
		4:   "DT_UINT8",
		5:   "DT_INT16",
		6:   "DT_INT8",
		7:   "DT_STRING",
		8:   "DT_COMPLEX64",
		9:   "DT_INT64",
		10:  "DT_BOOL",
		11:  "DT_QINT8",
		12:  "DT_QUINT8",
		13:  "DT_QINT32",
		14:  "DT_BFLOAT16",
		15:  "DT_QINT16",
		16:  "DT_QUINT16",
		17:  "DT_UINT16",
		18:  "DT_COMPLEX128",
		19:  "DT_HALF",
		20:  "DT_RESOURCE",
		21:  "DT_VARIANT",
		22:  "DT_UINT32",
		23:  "DT_UINT64",
		101: "DT_FLOAT_REF",
		102: "DT_DOUBLE_REF",
		103: "DT_INT32_REF",
		104: "DT_UINT8_REF",
		105: "DT_INT16_REF",
		106: "DT_INT8_REF",
		107: "DT_STRING_REF",
		108: "DT_COMPLEX64_REF",
		109: "DT_INT64_REF",
		110: "DT_BOOL_REF",
		111: "DT_QINT8_REF",
		112: "DT_QUINT8_REF",
		113: "DT_QINT32_REF",
		114: "DT_BFLOAT16_REF",
		115: "DT_QINT16_REF",
		116: "DT_QUINT16_REF",
		117: "DT_UINT16_REF",
		118: "DT_COMPLEX128_REF",
		119: "DT_HALF_REF",
		120: "DT_RESOURCE_REF",
		121: "DT_VARIANT_REF",
		122: "DT_UINT32_REF",
		123: "DT_UINT64_REF",
	}
	DataType_value = map[string]int32{
		"DT_INVALID":        0,
		"DT_FLOAT":          1,
		"DT_DOUBLE":         2,
		"DT_INT32":          3,
		"DT_UINT8":          4,
		"DT_INT16":          5,
		"DT_INT8":           6,
		"DT_STRING":         7,
		"DT_COMPLEX64":      8,
		"DT_INT64":          9,
		"DT_BOOL":           10,
		"DT_QINT8":          11,
		"DT_QUINT8":         12,
		"DT_QINT32":         13,
		"DT_BFLOAT16":       14,
		"DT_QINT16":         15,
		"DT_QUINT16":        16,
		"DT_UINT16":         17,
		"DT_COMPLEX128":     18,
		"DT_HALF":           19,
		"DT_RESOURCE":       20,
		"DT_VARIANT":        21,
		"DT_UINT32":         22,
		"DT_UINT64":         23,
		"DT_FLOAT_REF":      101,
		"DT_DOUBLE_REF":     102,
		"DT_INT32_REF":      103,
		"DT_UINT8_REF":      104,
		"DT_INT16_REF":      105,
		"DT_INT8_REF":       106,
		"DT_STRING_REF":     107,
		"DT_COMPLEX64_REF":  108,
		"DT_INT64_REF":      109,
		"DT_BOOL_REF":       110,
		"DT_QINT8_REF":      111,
		"DT_QUINT8_REF":     112,
		"DT_QINT32_REF":     113,
		"DT_BFLOAT16_REF":   114,
		"DT_QINT16_REF":     115,
		"DT_QUINT16_REF":    116,
		"DT_UINT16_REF":     117,
		"DT_COMPLEX128_REF": 118,
		"DT_HALF_REF":       119,
		"DT_RESOURCE_REF":   120,
		"DT_VARIANT_REF":    121,
		"DT_UINT32_REF":     122,
		"DT_UINT64_REF":     123,
	}
)

Enum value maps for DataType.

View Source
var File_tensorflow_core_framework_resource_handle_proto protoreflect.FileDescriptor
View Source
var File_tensorflow_core_framework_tensor_proto protoreflect.FileDescriptor
View Source
var File_tensorflow_core_framework_tensor_shape_proto protoreflect.FileDescriptor
View Source
var File_tensorflow_core_framework_types_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type DataType

type DataType int32

(== suppress_warning documentation-presence ==) LINT.IfChange

const (
	// Not a legal value for DataType.  Used to indicate a DataType field
	// has not been set.
	DataType_DT_INVALID DataType = 0
	// Data types that all computation devices are expected to be
	// capable to support.
	DataType_DT_FLOAT      DataType = 1
	DataType_DT_DOUBLE     DataType = 2
	DataType_DT_INT32      DataType = 3
	DataType_DT_UINT8      DataType = 4
	DataType_DT_INT16      DataType = 5
	DataType_DT_INT8       DataType = 6
	DataType_DT_STRING     DataType = 7
	DataType_DT_COMPLEX64  DataType = 8 // Single-precision complex
	DataType_DT_INT64      DataType = 9
	DataType_DT_BOOL       DataType = 10
	DataType_DT_QINT8      DataType = 11 // Quantized int8
	DataType_DT_QUINT8     DataType = 12 // Quantized uint8
	DataType_DT_QINT32     DataType = 13 // Quantized int32
	DataType_DT_BFLOAT16   DataType = 14 // Float32 truncated to 16 bits.  Only for cast ops.
	DataType_DT_QINT16     DataType = 15 // Quantized int16
	DataType_DT_QUINT16    DataType = 16 // Quantized uint16
	DataType_DT_UINT16     DataType = 17
	DataType_DT_COMPLEX128 DataType = 18 // Double-precision complex
	DataType_DT_HALF       DataType = 19
	DataType_DT_RESOURCE   DataType = 20
	DataType_DT_VARIANT    DataType = 21 // Arbitrary C++ data types
	DataType_DT_UINT32     DataType = 22
	DataType_DT_UINT64     DataType = 23
	// Do not use!  These are only for parameters.  Every enum above
	// should have a corresponding value below (verified by types_test).
	DataType_DT_FLOAT_REF      DataType = 101
	DataType_DT_DOUBLE_REF     DataType = 102
	DataType_DT_INT32_REF      DataType = 103
	DataType_DT_UINT8_REF      DataType = 104
	DataType_DT_INT16_REF      DataType = 105
	DataType_DT_INT8_REF       DataType = 106
	DataType_DT_STRING_REF     DataType = 107
	DataType_DT_COMPLEX64_REF  DataType = 108
	DataType_DT_INT64_REF      DataType = 109
	DataType_DT_BOOL_REF       DataType = 110
	DataType_DT_QINT8_REF      DataType = 111
	DataType_DT_QUINT8_REF     DataType = 112
	DataType_DT_QINT32_REF     DataType = 113
	DataType_DT_BFLOAT16_REF   DataType = 114
	DataType_DT_QINT16_REF     DataType = 115
	DataType_DT_QUINT16_REF    DataType = 116
	DataType_DT_UINT16_REF     DataType = 117
	DataType_DT_COMPLEX128_REF DataType = 118
	DataType_DT_HALF_REF       DataType = 119
	DataType_DT_RESOURCE_REF   DataType = 120
	DataType_DT_VARIANT_REF    DataType = 121
	DataType_DT_UINT32_REF     DataType = 122
	DataType_DT_UINT64_REF     DataType = 123
)

func (DataType) Descriptor

func (DataType) Descriptor() protoreflect.EnumDescriptor

func (DataType) Enum

func (x DataType) Enum() *DataType

func (DataType) EnumDescriptor deprecated

func (DataType) EnumDescriptor() ([]byte, []int)

Deprecated: Use DataType.Descriptor instead.

func (DataType) Number

func (x DataType) Number() protoreflect.EnumNumber

func (DataType) String

func (x DataType) String() string

func (DataType) Type

type ResourceHandleProto

type ResourceHandleProto struct {

	// Unique name for the device containing the resource.
	Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
	// Container in which this resource is placed.
	Container string `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"`
	// Unique name of this resource.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// Hash code for the type of the resource. Is only valid in the same device
	// and in the same execution.
	HashCode uint64 `protobuf:"varint,4,opt,name=hash_code,json=hashCode,proto3" json:"hash_code,omitempty"`
	// For debug-only, the name of the type pointed to by this handle, if
	// available.
	MaybeTypeName string `protobuf:"bytes,5,opt,name=maybe_type_name,json=maybeTypeName,proto3" json:"maybe_type_name,omitempty"`
	// Data types and shapes for the underlying resource.
	DtypesAndShapes []*ResourceHandleProto_DtypeAndShape `protobuf:"bytes,6,rep,name=dtypes_and_shapes,json=dtypesAndShapes,proto3" json:"dtypes_and_shapes,omitempty"`
	// contains filtered or unexported fields
}

Protocol buffer representing a handle to a tensorflow resource. Handles are not valid across executions, but can be serialized back and forth from within a single run.

func (*ResourceHandleProto) Descriptor deprecated

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

Deprecated: Use ResourceHandleProto.ProtoReflect.Descriptor instead.

func (*ResourceHandleProto) GetContainer

func (x *ResourceHandleProto) GetContainer() string

func (*ResourceHandleProto) GetDevice

func (x *ResourceHandleProto) GetDevice() string

func (*ResourceHandleProto) GetDtypesAndShapes

func (x *ResourceHandleProto) GetDtypesAndShapes() []*ResourceHandleProto_DtypeAndShape

func (*ResourceHandleProto) GetHashCode

func (x *ResourceHandleProto) GetHashCode() uint64

func (*ResourceHandleProto) GetMaybeTypeName

func (x *ResourceHandleProto) GetMaybeTypeName() string

func (*ResourceHandleProto) GetName

func (x *ResourceHandleProto) GetName() string

func (*ResourceHandleProto) ProtoMessage

func (*ResourceHandleProto) ProtoMessage()

func (*ResourceHandleProto) ProtoReflect

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

func (*ResourceHandleProto) Reset

func (x *ResourceHandleProto) Reset()

func (*ResourceHandleProto) String

func (x *ResourceHandleProto) String() string

type ResourceHandleProto_DtypeAndShape

type ResourceHandleProto_DtypeAndShape struct {
	Dtype DataType          `protobuf:"varint,1,opt,name=dtype,proto3,enum=tensorflow.DataType" json:"dtype,omitempty"`
	Shape *TensorShapeProto `protobuf:"bytes,2,opt,name=shape,proto3" json:"shape,omitempty"`
	// contains filtered or unexported fields
}

Protocol buffer representing a pair of (data type, tensor shape).

func (*ResourceHandleProto_DtypeAndShape) Descriptor deprecated

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

Deprecated: Use ResourceHandleProto_DtypeAndShape.ProtoReflect.Descriptor instead.

func (*ResourceHandleProto_DtypeAndShape) GetDtype

func (*ResourceHandleProto_DtypeAndShape) GetShape

func (*ResourceHandleProto_DtypeAndShape) ProtoMessage

func (*ResourceHandleProto_DtypeAndShape) ProtoMessage()

func (*ResourceHandleProto_DtypeAndShape) ProtoReflect

func (*ResourceHandleProto_DtypeAndShape) Reset

func (*ResourceHandleProto_DtypeAndShape) String

type TensorProto

type TensorProto struct {
	Dtype DataType `protobuf:"varint,1,opt,name=dtype,proto3,enum=tensorflow.DataType" json:"dtype,omitempty"`
	// Shape of the tensor.  TODO(touts): sort out the 0-rank issues.
	TensorShape *TensorShapeProto `protobuf:"bytes,2,opt,name=tensor_shape,json=tensorShape,proto3" json:"tensor_shape,omitempty"`
	// Version number.
	//
	// In version 0, if the "repeated xxx" representations contain only one
	// element, that element is repeated to fill the shape.  This makes it easy
	// to represent a constant Tensor with a single value.
	VersionNumber int32 `protobuf:"varint,3,opt,name=version_number,json=versionNumber,proto3" json:"version_number,omitempty"`
	// Serialized raw tensor content from either Tensor::AsProtoTensorContent or
	// memcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation
	// can be used for all tensor types. The purpose of this representation is to
	// reduce serialization overhead during RPC call by avoiding serialization of
	// many repeated small items.
	TensorContent []byte `protobuf:"bytes,4,opt,name=tensor_content,json=tensorContent,proto3" json:"tensor_content,omitempty"`
	// DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll
	// have some pointless zero padding for each value here.
	HalfVal []int32 `protobuf:"varint,13,rep,packed,name=half_val,json=halfVal,proto3" json:"half_val,omitempty"`
	// DT_FLOAT.
	FloatVal []float32 `protobuf:"fixed32,5,rep,packed,name=float_val,json=floatVal,proto3" json:"float_val,omitempty"`
	// DT_DOUBLE.
	DoubleVal []float64 `protobuf:"fixed64,6,rep,packed,name=double_val,json=doubleVal,proto3" json:"double_val,omitempty"`
	// DT_INT32, DT_INT16, DT_UINT16, DT_INT8, DT_UINT8.
	IntVal []int32 `protobuf:"varint,7,rep,packed,name=int_val,json=intVal,proto3" json:"int_val,omitempty"`
	// DT_STRING
	StringVal [][]byte `protobuf:"bytes,8,rep,name=string_val,json=stringVal,proto3" json:"string_val,omitempty"`
	// DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real
	// and imaginary parts of i-th single precision complex.
	ScomplexVal []float32 `protobuf:"fixed32,9,rep,packed,name=scomplex_val,json=scomplexVal,proto3" json:"scomplex_val,omitempty"`
	// DT_INT64
	Int64Val []int64 `protobuf:"varint,10,rep,packed,name=int64_val,json=int64Val,proto3" json:"int64_val,omitempty"`
	// DT_BOOL
	BoolVal []bool `protobuf:"varint,11,rep,packed,name=bool_val,json=boolVal,proto3" json:"bool_val,omitempty"`
	// DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real
	// and imaginary parts of i-th double precision complex.
	DcomplexVal []float64 `protobuf:"fixed64,12,rep,packed,name=dcomplex_val,json=dcomplexVal,proto3" json:"dcomplex_val,omitempty"`
	// DT_RESOURCE
	ResourceHandleVal []*ResourceHandleProto `protobuf:"bytes,14,rep,name=resource_handle_val,json=resourceHandleVal,proto3" json:"resource_handle_val,omitempty"`
	// DT_VARIANT
	VariantVal []*VariantTensorDataProto `protobuf:"bytes,15,rep,name=variant_val,json=variantVal,proto3" json:"variant_val,omitempty"`
	// DT_UINT32
	Uint32Val []uint32 `protobuf:"varint,16,rep,packed,name=uint32_val,json=uint32Val,proto3" json:"uint32_val,omitempty"`
	// DT_UINT64
	Uint64Val []uint64 `protobuf:"varint,17,rep,packed,name=uint64_val,json=uint64Val,proto3" json:"uint64_val,omitempty"`
	// contains filtered or unexported fields
}

Protocol buffer representing a tensor.

func (*TensorProto) Descriptor deprecated

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

Deprecated: Use TensorProto.ProtoReflect.Descriptor instead.

func (*TensorProto) GetBoolVal

func (x *TensorProto) GetBoolVal() []bool

func (*TensorProto) GetDcomplexVal

func (x *TensorProto) GetDcomplexVal() []float64

func (*TensorProto) GetDoubleVal

func (x *TensorProto) GetDoubleVal() []float64

func (*TensorProto) GetDtype

func (x *TensorProto) GetDtype() DataType

func (*TensorProto) GetFloatVal

func (x *TensorProto) GetFloatVal() []float32

func (*TensorProto) GetHalfVal

func (x *TensorProto) GetHalfVal() []int32

func (*TensorProto) GetInt64Val

func (x *TensorProto) GetInt64Val() []int64

func (*TensorProto) GetIntVal

func (x *TensorProto) GetIntVal() []int32

func (*TensorProto) GetResourceHandleVal

func (x *TensorProto) GetResourceHandleVal() []*ResourceHandleProto

func (*TensorProto) GetScomplexVal

func (x *TensorProto) GetScomplexVal() []float32

func (*TensorProto) GetStringVal

func (x *TensorProto) GetStringVal() [][]byte

func (*TensorProto) GetTensorContent

func (x *TensorProto) GetTensorContent() []byte

func (*TensorProto) GetTensorShape

func (x *TensorProto) GetTensorShape() *TensorShapeProto

func (*TensorProto) GetUint32Val

func (x *TensorProto) GetUint32Val() []uint32

func (*TensorProto) GetUint64Val

func (x *TensorProto) GetUint64Val() []uint64

func (*TensorProto) GetVariantVal

func (x *TensorProto) GetVariantVal() []*VariantTensorDataProto

func (*TensorProto) GetVersionNumber

func (x *TensorProto) GetVersionNumber() int32

func (*TensorProto) ProtoMessage

func (*TensorProto) ProtoMessage()

func (*TensorProto) ProtoReflect

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

func (*TensorProto) Reset

func (x *TensorProto) Reset()

func (*TensorProto) String

func (x *TensorProto) String() string

type TensorShapeProto

type TensorShapeProto struct {

	// Dimensions of the tensor, such as {"input", 30}, {"output", 40}
	// for a 30 x 40 2D tensor.  If an entry has size -1, this
	// corresponds to a dimension of unknown size. The names are
	// optional.
	//
	// The order of entries in "dim" matters: It indicates the layout of the
	// values in the tensor in-memory representation.
	//
	// The first entry in "dim" is the outermost dimension used to layout the
	// values, the last entry is the innermost dimension.  This matches the
	// in-memory layout of RowMajor Eigen tensors.
	//
	// If "dim.size()" > 0, "unknown_rank" must be false.
	Dim []*TensorShapeProto_Dim `protobuf:"bytes,2,rep,name=dim,proto3" json:"dim,omitempty"`
	// If true, the number of dimensions in the shape is unknown.
	//
	// If true, "dim.size()" must be 0.
	UnknownRank bool `protobuf:"varint,3,opt,name=unknown_rank,json=unknownRank,proto3" json:"unknown_rank,omitempty"`
	// contains filtered or unexported fields
}

Dimensions of a tensor.

func (*TensorShapeProto) Descriptor deprecated

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

Deprecated: Use TensorShapeProto.ProtoReflect.Descriptor instead.

func (*TensorShapeProto) GetDim

func (x *TensorShapeProto) GetDim() []*TensorShapeProto_Dim

func (*TensorShapeProto) GetUnknownRank

func (x *TensorShapeProto) GetUnknownRank() bool

func (*TensorShapeProto) ProtoMessage

func (*TensorShapeProto) ProtoMessage()

func (*TensorShapeProto) ProtoReflect

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

func (*TensorShapeProto) Reset

func (x *TensorShapeProto) Reset()

func (*TensorShapeProto) String

func (x *TensorShapeProto) String() string

type TensorShapeProto_Dim

type TensorShapeProto_Dim struct {

	// Size of the tensor in that dimension.
	// This value must be >= -1, but values of -1 are reserved for "unknown"
	// shapes (values of -1 mean "unknown" dimension).  Certain wrappers
	// that work with TensorShapeProto may fail at runtime when deserializing
	// a TensorShapeProto containing a dim value of -1.
	Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	// Optional name of the tensor dimension.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

One dimension of the tensor.

func (*TensorShapeProto_Dim) Descriptor deprecated

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

Deprecated: Use TensorShapeProto_Dim.ProtoReflect.Descriptor instead.

func (*TensorShapeProto_Dim) GetName

func (x *TensorShapeProto_Dim) GetName() string

func (*TensorShapeProto_Dim) GetSize

func (x *TensorShapeProto_Dim) GetSize() int64

func (*TensorShapeProto_Dim) ProtoMessage

func (*TensorShapeProto_Dim) ProtoMessage()

func (*TensorShapeProto_Dim) ProtoReflect

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

func (*TensorShapeProto_Dim) Reset

func (x *TensorShapeProto_Dim) Reset()

func (*TensorShapeProto_Dim) String

func (x *TensorShapeProto_Dim) String() string

type VariantTensorDataProto

type VariantTensorDataProto struct {

	// Name of the type of objects being serialized.
	TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"`
	// Portions of the object that are not Tensors.
	Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Tensors contained within objects being serialized.
	Tensors []*TensorProto `protobuf:"bytes,3,rep,name=tensors,proto3" json:"tensors,omitempty"`
	// contains filtered or unexported fields
}

Protocol buffer representing the serialization format of DT_VARIANT tensors.

func (*VariantTensorDataProto) Descriptor deprecated

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

Deprecated: Use VariantTensorDataProto.ProtoReflect.Descriptor instead.

func (*VariantTensorDataProto) GetMetadata

func (x *VariantTensorDataProto) GetMetadata() []byte

func (*VariantTensorDataProto) GetTensors

func (x *VariantTensorDataProto) GetTensors() []*TensorProto

func (*VariantTensorDataProto) GetTypeName

func (x *VariantTensorDataProto) GetTypeName() string

func (*VariantTensorDataProto) ProtoMessage

func (*VariantTensorDataProto) ProtoMessage()

func (*VariantTensorDataProto) ProtoReflect

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

func (*VariantTensorDataProto) Reset

func (x *VariantTensorDataProto) Reset()

func (*VariantTensorDataProto) String

func (x *VariantTensorDataProto) String() string

Jump to

Keyboard shortcuts

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