protobuf

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SaverDef_CheckpointFormatVersion_name = map[int32]string{
	0: "LEGACY",
	1: "V1",
	2: "V2",
}
View Source
var SaverDef_CheckpointFormatVersion_value = map[string]int32{
	"LEGACY": 0,
	"V1":     1,
	"V2":     2,
}

Functions

This section is empty.

Types

type AssetFileDef

type AssetFileDef struct {
	// The tensor to bind the asset filename to.
	TensorInfo *TensorInfo `protobuf:"bytes,1,opt,name=tensor_info,json=tensorInfo,proto3" json:"tensor_info,omitempty"`
	// The filename within an assets directory. Note: does not include the path
	// prefix, i.e. directories. For an asset at /tmp/path/vocab.txt, the filename
	// would be "vocab.txt".
	Filename             string   `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

An asset file def for a single file or a set of sharded files with the same name.

func (*AssetFileDef) Descriptor

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

func (*AssetFileDef) GetFilename

func (m *AssetFileDef) GetFilename() string

func (*AssetFileDef) GetTensorInfo

func (m *AssetFileDef) GetTensorInfo() *TensorInfo

func (*AssetFileDef) ProtoMessage

func (*AssetFileDef) ProtoMessage()

func (*AssetFileDef) Reset

func (m *AssetFileDef) Reset()

func (*AssetFileDef) String

func (m *AssetFileDef) String() string

func (*AssetFileDef) XXX_DiscardUnknown

func (m *AssetFileDef) XXX_DiscardUnknown()

func (*AssetFileDef) XXX_Marshal

func (m *AssetFileDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AssetFileDef) XXX_Merge

func (m *AssetFileDef) XXX_Merge(src proto.Message)

func (*AssetFileDef) XXX_Size

func (m *AssetFileDef) XXX_Size() int

func (*AssetFileDef) XXX_Unmarshal

func (m *AssetFileDef) XXX_Unmarshal(b []byte) error

type CollectionDef

type CollectionDef struct {
	// Types that are valid to be assigned to Kind:
	//	*CollectionDef_NodeList_
	//	*CollectionDef_BytesList_
	//	*CollectionDef_Int64List_
	//	*CollectionDef_FloatList_
	//	*CollectionDef_AnyList_
	Kind                 isCollectionDef_Kind `protobuf_oneof:"kind"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

CollectionDef should cover most collections. To add a user-defined collection, do one of the following:

  1. For simple data types, such as string, int, float: tf.add_to_collection("your_collection_name", your_simple_value) strings will be stored as bytes_list.

2. For Protobuf types, there are three ways to add them:

  1. tf.add_to_collection("your_collection_name", your_proto.SerializeToString())

    collection_def { key: "user_defined_bytes_collection" value { bytes_list { value: "queue_name: \"test_queue\"\n" } } }

    or

  2. tf.add_to_collection("your_collection_name", str(your_proto))

    collection_def { key: "user_defined_string_collection" value { bytes_list { value: "\n\ntest_queue" } } }

    or

  3. any_buf = any_pb2.Any() tf.add_to_collection("your_collection_name", any_buf.Pack(your_proto))

    collection_def { key: "user_defined_any_collection" value { any_list { value { type_url: "type.googleapis.com/tensorflow.QueueRunnerDef" value: "\n\ntest_queue" } } } }

  1. For Python objects, implement to_proto() and from_proto(), and register them in the following manner: ops.register_proto_function("your_collection_name", proto_type, to_proto=YourPythonObject.to_proto, from_proto=YourPythonObject.from_proto) These functions will be invoked to serialize and de-serialize the collection. For example, ops.register_proto_function(ops.GraphKeys.GLOBAL_VARIABLES, proto_type=variable_pb2.VariableDef, to_proto=Variable.to_proto, from_proto=Variable.from_proto)

func (*CollectionDef) Descriptor

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

func (*CollectionDef) GetAnyList

func (m *CollectionDef) GetAnyList() *CollectionDef_AnyList

func (*CollectionDef) GetBytesList

func (m *CollectionDef) GetBytesList() *CollectionDef_BytesList

func (*CollectionDef) GetFloatList

func (m *CollectionDef) GetFloatList() *CollectionDef_FloatList

func (*CollectionDef) GetInt64List

func (m *CollectionDef) GetInt64List() *CollectionDef_Int64List

func (*CollectionDef) GetKind

func (m *CollectionDef) GetKind() isCollectionDef_Kind

func (*CollectionDef) GetNodeList

func (m *CollectionDef) GetNodeList() *CollectionDef_NodeList

func (*CollectionDef) ProtoMessage

func (*CollectionDef) ProtoMessage()

func (*CollectionDef) Reset

func (m *CollectionDef) Reset()

func (*CollectionDef) String

func (m *CollectionDef) String() string

func (*CollectionDef) XXX_DiscardUnknown

func (m *CollectionDef) XXX_DiscardUnknown()

func (*CollectionDef) XXX_Marshal

func (m *CollectionDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CollectionDef) XXX_Merge

func (m *CollectionDef) XXX_Merge(src proto.Message)

func (*CollectionDef) XXX_OneofWrappers

func (*CollectionDef) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*CollectionDef) XXX_Size

func (m *CollectionDef) XXX_Size() int

func (*CollectionDef) XXX_Unmarshal

func (m *CollectionDef) XXX_Unmarshal(b []byte) error

type CollectionDef_AnyList

type CollectionDef_AnyList struct {
	Value                []*any.Any `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

AnyList is used for collecting Any protos.

func (*CollectionDef_AnyList) Descriptor

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

func (*CollectionDef_AnyList) GetValue

func (m *CollectionDef_AnyList) GetValue() []*any.Any

func (*CollectionDef_AnyList) ProtoMessage

func (*CollectionDef_AnyList) ProtoMessage()

func (*CollectionDef_AnyList) Reset

func (m *CollectionDef_AnyList) Reset()

func (*CollectionDef_AnyList) String

func (m *CollectionDef_AnyList) String() string

func (*CollectionDef_AnyList) XXX_DiscardUnknown

func (m *CollectionDef_AnyList) XXX_DiscardUnknown()

func (*CollectionDef_AnyList) XXX_Marshal

func (m *CollectionDef_AnyList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CollectionDef_AnyList) XXX_Merge

func (m *CollectionDef_AnyList) XXX_Merge(src proto.Message)

func (*CollectionDef_AnyList) XXX_Size

func (m *CollectionDef_AnyList) XXX_Size() int

func (*CollectionDef_AnyList) XXX_Unmarshal

func (m *CollectionDef_AnyList) XXX_Unmarshal(b []byte) error

type CollectionDef_AnyList_

type CollectionDef_AnyList_ struct {
	AnyList *CollectionDef_AnyList `protobuf:"bytes,5,opt,name=any_list,json=anyList,proto3,oneof"`
}

type CollectionDef_BytesList

type CollectionDef_BytesList struct {
	Value                [][]byte `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

BytesList is used for collecting strings and serialized protobufs. For example:

collection_def {
  key: "trainable_variables"
  value {
    bytes_list {
      value: "\n\017conv1/weights:0\022\024conv1/weights/Assign
             \032\024conv1/weights/read:0"
      value: "\n\016conv1/biases:0\022\023conv1/biases/Assign\032
             \023conv1/biases/read:0"
    }
  }
}

func (*CollectionDef_BytesList) Descriptor

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

func (*CollectionDef_BytesList) GetValue

func (m *CollectionDef_BytesList) GetValue() [][]byte

func (*CollectionDef_BytesList) ProtoMessage

func (*CollectionDef_BytesList) ProtoMessage()

func (*CollectionDef_BytesList) Reset

func (m *CollectionDef_BytesList) Reset()

func (*CollectionDef_BytesList) String

func (m *CollectionDef_BytesList) String() string

func (*CollectionDef_BytesList) XXX_DiscardUnknown

func (m *CollectionDef_BytesList) XXX_DiscardUnknown()

func (*CollectionDef_BytesList) XXX_Marshal

func (m *CollectionDef_BytesList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CollectionDef_BytesList) XXX_Merge

func (m *CollectionDef_BytesList) XXX_Merge(src proto.Message)

func (*CollectionDef_BytesList) XXX_Size

func (m *CollectionDef_BytesList) XXX_Size() int

func (*CollectionDef_BytesList) XXX_Unmarshal

func (m *CollectionDef_BytesList) XXX_Unmarshal(b []byte) error

type CollectionDef_BytesList_

type CollectionDef_BytesList_ struct {
	BytesList *CollectionDef_BytesList `protobuf:"bytes,2,opt,name=bytes_list,json=bytesList,proto3,oneof"`
}

type CollectionDef_FloatList

type CollectionDef_FloatList struct {
	Value                []float32 `protobuf:"fixed32,1,rep,packed,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

FloatList is used for collecting float values.

func (*CollectionDef_FloatList) Descriptor

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

func (*CollectionDef_FloatList) GetValue

func (m *CollectionDef_FloatList) GetValue() []float32

func (*CollectionDef_FloatList) ProtoMessage

func (*CollectionDef_FloatList) ProtoMessage()

func (*CollectionDef_FloatList) Reset

func (m *CollectionDef_FloatList) Reset()

func (*CollectionDef_FloatList) String

func (m *CollectionDef_FloatList) String() string

func (*CollectionDef_FloatList) XXX_DiscardUnknown

func (m *CollectionDef_FloatList) XXX_DiscardUnknown()

func (*CollectionDef_FloatList) XXX_Marshal

func (m *CollectionDef_FloatList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CollectionDef_FloatList) XXX_Merge

func (m *CollectionDef_FloatList) XXX_Merge(src proto.Message)

func (*CollectionDef_FloatList) XXX_Size

func (m *CollectionDef_FloatList) XXX_Size() int

func (*CollectionDef_FloatList) XXX_Unmarshal

func (m *CollectionDef_FloatList) XXX_Unmarshal(b []byte) error

type CollectionDef_FloatList_

type CollectionDef_FloatList_ struct {
	FloatList *CollectionDef_FloatList `protobuf:"bytes,4,opt,name=float_list,json=floatList,proto3,oneof"`
}

type CollectionDef_Int64List

type CollectionDef_Int64List struct {
	Value                []int64  `protobuf:"varint,1,rep,packed,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Int64List is used for collecting int, int64 and long values.

func (*CollectionDef_Int64List) Descriptor

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

func (*CollectionDef_Int64List) GetValue

func (m *CollectionDef_Int64List) GetValue() []int64

func (*CollectionDef_Int64List) ProtoMessage

func (*CollectionDef_Int64List) ProtoMessage()

func (*CollectionDef_Int64List) Reset

func (m *CollectionDef_Int64List) Reset()

func (*CollectionDef_Int64List) String

func (m *CollectionDef_Int64List) String() string

func (*CollectionDef_Int64List) XXX_DiscardUnknown

func (m *CollectionDef_Int64List) XXX_DiscardUnknown()

func (*CollectionDef_Int64List) XXX_Marshal

func (m *CollectionDef_Int64List) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CollectionDef_Int64List) XXX_Merge

func (m *CollectionDef_Int64List) XXX_Merge(src proto.Message)

func (*CollectionDef_Int64List) XXX_Size

func (m *CollectionDef_Int64List) XXX_Size() int

func (*CollectionDef_Int64List) XXX_Unmarshal

func (m *CollectionDef_Int64List) XXX_Unmarshal(b []byte) error

type CollectionDef_Int64List_

type CollectionDef_Int64List_ struct {
	Int64List *CollectionDef_Int64List `protobuf:"bytes,3,opt,name=int64_list,json=int64List,proto3,oneof"`
}

type CollectionDef_NodeList

type CollectionDef_NodeList struct {
	Value                []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

NodeList is used for collecting nodes in graph. For example

collection_def {
  key: "summaries"
  value {
    node_list {
      value: "input_producer/ScalarSummary:0"
      value: "shuffle_batch/ScalarSummary:0"
      value: "ImageSummary:0"
    }
  }

func (*CollectionDef_NodeList) Descriptor

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

func (*CollectionDef_NodeList) GetValue

func (m *CollectionDef_NodeList) GetValue() []string

func (*CollectionDef_NodeList) ProtoMessage

func (*CollectionDef_NodeList) ProtoMessage()

func (*CollectionDef_NodeList) Reset

func (m *CollectionDef_NodeList) Reset()

func (*CollectionDef_NodeList) String

func (m *CollectionDef_NodeList) String() string

func (*CollectionDef_NodeList) XXX_DiscardUnknown

func (m *CollectionDef_NodeList) XXX_DiscardUnknown()

func (*CollectionDef_NodeList) XXX_Marshal

func (m *CollectionDef_NodeList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CollectionDef_NodeList) XXX_Merge

func (m *CollectionDef_NodeList) XXX_Merge(src proto.Message)

func (*CollectionDef_NodeList) XXX_Size

func (m *CollectionDef_NodeList) XXX_Size() int

func (*CollectionDef_NodeList) XXX_Unmarshal

func (m *CollectionDef_NodeList) XXX_Unmarshal(b []byte) error

type CollectionDef_NodeList_

type CollectionDef_NodeList_ struct {
	NodeList *CollectionDef_NodeList `protobuf:"bytes,1,opt,name=node_list,json=nodeList,proto3,oneof"`
}

type MetaGraphDef

type MetaGraphDef struct {
	MetaInfoDef *MetaGraphDef_MetaInfoDef `protobuf:"bytes,1,opt,name=meta_info_def,json=metaInfoDef,proto3" json:"meta_info_def,omitempty"`
	// GraphDef.
	GraphDef *framework.GraphDef `protobuf:"bytes,2,opt,name=graph_def,json=graphDef,proto3" json:"graph_def,omitempty"`
	// SaverDef.
	SaverDef *SaverDef `protobuf:"bytes,3,opt,name=saver_def,json=saverDef,proto3" json:"saver_def,omitempty"`
	// collection_def: Map from collection name to collections.
	// See CollectionDef section for details.
	CollectionDef map[string]*CollectionDef `` /* 188-byte string literal not displayed */
	// signature_def: Map from user supplied key for a signature to a single
	// SignatureDef.
	SignatureDef map[string]*SignatureDef `` /* 185-byte string literal not displayed */
	// Asset file def to be used with the defined graph.
	AssetFileDef         []*AssetFileDef `protobuf:"bytes,6,rep,name=asset_file_def,json=assetFileDef,proto3" json:"asset_file_def,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

NOTE: This protocol buffer is evolving, and will go through revisions in the coming months.

Protocol buffer containing the following which are necessary to restart training, run inference. It can be used to serialize/de-serialize memory objects necessary for running computation in a graph when crossing the process boundary. It can be used for long term storage of graphs, cross-language execution of graphs, etc.

MetaInfoDef
GraphDef
SaverDef
CollectionDef
TensorInfo
SignatureDef

func (*MetaGraphDef) Descriptor

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

func (*MetaGraphDef) GetAssetFileDef

func (m *MetaGraphDef) GetAssetFileDef() []*AssetFileDef

func (*MetaGraphDef) GetCollectionDef

func (m *MetaGraphDef) GetCollectionDef() map[string]*CollectionDef

func (*MetaGraphDef) GetGraphDef

func (m *MetaGraphDef) GetGraphDef() *framework.GraphDef

func (*MetaGraphDef) GetMetaInfoDef

func (m *MetaGraphDef) GetMetaInfoDef() *MetaGraphDef_MetaInfoDef

func (*MetaGraphDef) GetSaverDef

func (m *MetaGraphDef) GetSaverDef() *SaverDef

func (*MetaGraphDef) GetSignatureDef

func (m *MetaGraphDef) GetSignatureDef() map[string]*SignatureDef

func (*MetaGraphDef) ProtoMessage

func (*MetaGraphDef) ProtoMessage()

func (*MetaGraphDef) Reset

func (m *MetaGraphDef) Reset()

func (*MetaGraphDef) String

func (m *MetaGraphDef) String() string

func (*MetaGraphDef) XXX_DiscardUnknown

func (m *MetaGraphDef) XXX_DiscardUnknown()

func (*MetaGraphDef) XXX_Marshal

func (m *MetaGraphDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetaGraphDef) XXX_Merge

func (m *MetaGraphDef) XXX_Merge(src proto.Message)

func (*MetaGraphDef) XXX_Size

func (m *MetaGraphDef) XXX_Size() int

func (*MetaGraphDef) XXX_Unmarshal

func (m *MetaGraphDef) XXX_Unmarshal(b []byte) error

type MetaGraphDef_MetaInfoDef

type MetaGraphDef_MetaInfoDef struct {
	// User specified Version string. Can be the name of the model and revision,
	// steps this model has been trained to, etc.
	MetaGraphVersion string `protobuf:"bytes,1,opt,name=meta_graph_version,json=metaGraphVersion,proto3" json:"meta_graph_version,omitempty"`
	// A copy of the OpDefs used by the producer of this graph_def.
	// Descriptions and Ops not used in graph_def are stripped out.
	StrippedOpList *framework.OpList `protobuf:"bytes,2,opt,name=stripped_op_list,json=strippedOpList,proto3" json:"stripped_op_list,omitempty"`
	// A serialized protobuf. Can be the time this meta graph is created, or
	// modified, or name of the model.
	AnyInfo *any.Any `protobuf:"bytes,3,opt,name=any_info,json=anyInfo,proto3" json:"any_info,omitempty"`
	// User supplied tag(s) on the meta_graph and included graph_def.
	//
	// MetaGraphDefs should be tagged with their capabilities or use-cases.
	// Examples: "train", "serve", "gpu", "tpu", etc.
	// These tags enable loaders to access the MetaGraph(s) appropriate for a
	// specific use-case or runtime environment.
	Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"`
	// The __version__ string of the tensorflow build used to write this graph.
	// This will be populated by the framework, which will overwrite any user
	// supplied value.
	TensorflowVersion string `protobuf:"bytes,5,opt,name=tensorflow_version,json=tensorflowVersion,proto3" json:"tensorflow_version,omitempty"`
	// The __git_version__ string of the tensorflow build used to write this
	// graph. This will be populated by the framework, which will overwrite any
	// user supplied value.
	TensorflowGitVersion string `protobuf:"bytes,6,opt,name=tensorflow_git_version,json=tensorflowGitVersion,proto3" json:"tensorflow_git_version,omitempty"`
	// A flag to denote whether default-valued attrs have been stripped from
	// the nodes in this graph_def.
	StrippedDefaultAttrs bool     `protobuf:"varint,7,opt,name=stripped_default_attrs,json=strippedDefaultAttrs,proto3" json:"stripped_default_attrs,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Meta information regarding the graph to be exported. To be used by users of this protocol buffer to encode information regarding their meta graph.

func (*MetaGraphDef_MetaInfoDef) Descriptor

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

func (*MetaGraphDef_MetaInfoDef) GetAnyInfo

func (m *MetaGraphDef_MetaInfoDef) GetAnyInfo() *any.Any

func (*MetaGraphDef_MetaInfoDef) GetMetaGraphVersion

func (m *MetaGraphDef_MetaInfoDef) GetMetaGraphVersion() string

func (*MetaGraphDef_MetaInfoDef) GetStrippedDefaultAttrs

func (m *MetaGraphDef_MetaInfoDef) GetStrippedDefaultAttrs() bool

func (*MetaGraphDef_MetaInfoDef) GetStrippedOpList

func (m *MetaGraphDef_MetaInfoDef) GetStrippedOpList() *framework.OpList

func (*MetaGraphDef_MetaInfoDef) GetTags

func (m *MetaGraphDef_MetaInfoDef) GetTags() []string

func (*MetaGraphDef_MetaInfoDef) GetTensorflowGitVersion

func (m *MetaGraphDef_MetaInfoDef) GetTensorflowGitVersion() string

func (*MetaGraphDef_MetaInfoDef) GetTensorflowVersion

func (m *MetaGraphDef_MetaInfoDef) GetTensorflowVersion() string

func (*MetaGraphDef_MetaInfoDef) ProtoMessage

func (*MetaGraphDef_MetaInfoDef) ProtoMessage()

func (*MetaGraphDef_MetaInfoDef) Reset

func (m *MetaGraphDef_MetaInfoDef) Reset()

func (*MetaGraphDef_MetaInfoDef) String

func (m *MetaGraphDef_MetaInfoDef) String() string

func (*MetaGraphDef_MetaInfoDef) XXX_DiscardUnknown

func (m *MetaGraphDef_MetaInfoDef) XXX_DiscardUnknown()

func (*MetaGraphDef_MetaInfoDef) XXX_Marshal

func (m *MetaGraphDef_MetaInfoDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetaGraphDef_MetaInfoDef) XXX_Merge

func (m *MetaGraphDef_MetaInfoDef) XXX_Merge(src proto.Message)

func (*MetaGraphDef_MetaInfoDef) XXX_Size

func (m *MetaGraphDef_MetaInfoDef) XXX_Size() int

func (*MetaGraphDef_MetaInfoDef) XXX_Unmarshal

func (m *MetaGraphDef_MetaInfoDef) XXX_Unmarshal(b []byte) error

type SavedModel

type SavedModel struct {
	// The schema version of the SavedModel instance. Used for versioning when
	// making future changes to the specification/implementation. Initial value
	// at release will be 1.
	SavedModelSchemaVersion int64 `` /* 135-byte string literal not displayed */
	// One or more MetaGraphs.
	MetaGraphs           []*MetaGraphDef `protobuf:"bytes,2,rep,name=meta_graphs,json=metaGraphs,proto3" json:"meta_graphs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

SavedModel is the high level serialization format for TensorFlow Models. See [todo: doc links, similar to session_bundle] for more information.

func (*SavedModel) Descriptor

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

func (*SavedModel) GetMetaGraphs

func (m *SavedModel) GetMetaGraphs() []*MetaGraphDef

func (*SavedModel) GetSavedModelSchemaVersion

func (m *SavedModel) GetSavedModelSchemaVersion() int64

func (*SavedModel) ProtoMessage

func (*SavedModel) ProtoMessage()

func (*SavedModel) Reset

func (m *SavedModel) Reset()

func (*SavedModel) String

func (m *SavedModel) String() string

func (*SavedModel) XXX_DiscardUnknown

func (m *SavedModel) XXX_DiscardUnknown()

func (*SavedModel) XXX_Marshal

func (m *SavedModel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SavedModel) XXX_Merge

func (m *SavedModel) XXX_Merge(src proto.Message)

func (*SavedModel) XXX_Size

func (m *SavedModel) XXX_Size() int

func (*SavedModel) XXX_Unmarshal

func (m *SavedModel) XXX_Unmarshal(b []byte) error

type SaverDef

type SaverDef struct {
	// The name of the tensor in which to specify the filename when saving or
	// restoring a model checkpoint.
	FilenameTensorName string `protobuf:"bytes,1,opt,name=filename_tensor_name,json=filenameTensorName,proto3" json:"filename_tensor_name,omitempty"`
	// The operation to run when saving a model checkpoint.
	SaveTensorName string `protobuf:"bytes,2,opt,name=save_tensor_name,json=saveTensorName,proto3" json:"save_tensor_name,omitempty"`
	// The operation to run when restoring a model checkpoint.
	RestoreOpName string `protobuf:"bytes,3,opt,name=restore_op_name,json=restoreOpName,proto3" json:"restore_op_name,omitempty"`
	// Maximum number of checkpoints to keep.  If 0, no checkpoints are deleted.
	MaxToKeep int32 `protobuf:"varint,4,opt,name=max_to_keep,json=maxToKeep,proto3" json:"max_to_keep,omitempty"`
	// Shard the save files, one per device that has Variable nodes.
	Sharded bool `protobuf:"varint,5,opt,name=sharded,proto3" json:"sharded,omitempty"`
	// How often to keep an additional checkpoint. If not specified, only the last
	// "max_to_keep" checkpoints are kept; if specified, in addition to keeping
	// the last "max_to_keep" checkpoints, an additional checkpoint will be kept
	// for every n hours of training.
	KeepCheckpointEveryNHours float32                          `` /* 144-byte string literal not displayed */
	Version                   SaverDef_CheckpointFormatVersion `protobuf:"varint,7,opt,name=version,proto3,enum=tensorflow.SaverDef_CheckpointFormatVersion" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral      struct{}                         `json:"-"`
	XXX_unrecognized          []byte                           `json:"-"`
	XXX_sizecache             int32                            `json:"-"`
}

Protocol buffer representing the configuration of a Saver.

func (*SaverDef) Descriptor

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

func (*SaverDef) GetFilenameTensorName

func (m *SaverDef) GetFilenameTensorName() string

func (*SaverDef) GetKeepCheckpointEveryNHours

func (m *SaverDef) GetKeepCheckpointEveryNHours() float32

func (*SaverDef) GetMaxToKeep

func (m *SaverDef) GetMaxToKeep() int32

func (*SaverDef) GetRestoreOpName

func (m *SaverDef) GetRestoreOpName() string

func (*SaverDef) GetSaveTensorName

func (m *SaverDef) GetSaveTensorName() string

func (*SaverDef) GetSharded

func (m *SaverDef) GetSharded() bool

func (*SaverDef) GetVersion

func (*SaverDef) ProtoMessage

func (*SaverDef) ProtoMessage()

func (*SaverDef) Reset

func (m *SaverDef) Reset()

func (*SaverDef) String

func (m *SaverDef) String() string

func (*SaverDef) XXX_DiscardUnknown

func (m *SaverDef) XXX_DiscardUnknown()

func (*SaverDef) XXX_Marshal

func (m *SaverDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SaverDef) XXX_Merge

func (m *SaverDef) XXX_Merge(src proto.Message)

func (*SaverDef) XXX_Size

func (m *SaverDef) XXX_Size() int

func (*SaverDef) XXX_Unmarshal

func (m *SaverDef) XXX_Unmarshal(b []byte) error

type SaverDef_CheckpointFormatVersion

type SaverDef_CheckpointFormatVersion int32

A version number that identifies a different on-disk checkpoint format. Usually, each subclass of BaseSaverBuilder works with a particular version/format. However, it is possible that the same builder may be upgraded to support a newer checkpoint format in the future.

const (
	// Internal legacy format.
	SaverDef_LEGACY SaverDef_CheckpointFormatVersion = 0
	// Deprecated format: tf.Saver() which works with tensorflow::table::Table.
	SaverDef_V1 SaverDef_CheckpointFormatVersion = 1
	// Current format: more efficient.
	SaverDef_V2 SaverDef_CheckpointFormatVersion = 2
)

func (SaverDef_CheckpointFormatVersion) EnumDescriptor

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

func (SaverDef_CheckpointFormatVersion) String

type SignatureDef

type SignatureDef struct {
	// Named input parameters.
	Inputs map[string]*TensorInfo `` /* 153-byte string literal not displayed */
	// Named output parameters.
	Outputs map[string]*TensorInfo `` /* 155-byte string literal not displayed */
	// Extensible method_name information enabling third-party users to mark a
	// SignatureDef as supporting a particular method. This enables producers and
	// consumers of SignatureDefs, e.g. a model definition library and a serving
	// library to have a clear hand-off regarding the semantics of a computation.
	//
	// Note that multiple SignatureDefs in a single MetaGraphDef may have the same
	// method_name. This is commonly used to support multi-headed computation,
	// where a single graph computation may return multiple results.
	MethodName           string   `protobuf:"bytes,3,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

SignatureDef defines the signature of a computation supported by a TensorFlow graph.

For example, a model with two loss computations, sharing a single input, might have the following signature_def map.

Note that across the two SignatureDefs "loss_A" and "loss_B", the input key, output key, and method_name are identical, and will be used by system(s) that implement or rely upon this particular loss method. The output tensor names differ, demonstrating how different outputs can exist for the same method.

signature_def {
  key: "loss_A"
  value {
    inputs {
      key: "input"
      value {
        name: "input:0"
        dtype: DT_STRING
        tensor_shape: ...
      }
    }
    outputs {
      key: "loss_output"
      value {
        name: "loss_output_A:0"
        dtype: DT_FLOAT
        tensor_shape: ...
      }
    }
  }
  ...
  method_name: "some/package/compute_loss"
}
signature_def {
  key: "loss_B"
  value {
    inputs {
      key: "input"
      value {
        name: "input:0"
        dtype: DT_STRING
        tensor_shape: ...
      }
    }
    outputs {
      key: "loss_output"
      value {
        name: "loss_output_B:0"
        dtype: DT_FLOAT
        tensor_shape: ...
      }
    }
  }
  ...
  method_name: "some/package/compute_loss"
}

func (*SignatureDef) Descriptor

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

func (*SignatureDef) GetInputs

func (m *SignatureDef) GetInputs() map[string]*TensorInfo

func (*SignatureDef) GetMethodName

func (m *SignatureDef) GetMethodName() string

func (*SignatureDef) GetOutputs

func (m *SignatureDef) GetOutputs() map[string]*TensorInfo

func (*SignatureDef) ProtoMessage

func (*SignatureDef) ProtoMessage()

func (*SignatureDef) Reset

func (m *SignatureDef) Reset()

func (*SignatureDef) String

func (m *SignatureDef) String() string

func (*SignatureDef) XXX_DiscardUnknown

func (m *SignatureDef) XXX_DiscardUnknown()

func (*SignatureDef) XXX_Marshal

func (m *SignatureDef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignatureDef) XXX_Merge

func (m *SignatureDef) XXX_Merge(src proto.Message)

func (*SignatureDef) XXX_Size

func (m *SignatureDef) XXX_Size() int

func (*SignatureDef) XXX_Unmarshal

func (m *SignatureDef) XXX_Unmarshal(b []byte) error

type TensorInfo

type TensorInfo struct {
	// Types that are valid to be assigned to Encoding:
	//	*TensorInfo_Name
	//	*TensorInfo_CooSparse_
	Encoding isTensorInfo_Encoding `protobuf_oneof:"encoding"`
	Dtype    framework.DataType    `protobuf:"varint,2,opt,name=dtype,proto3,enum=tensorflow.DataType" json:"dtype,omitempty"`
	// The static shape should be recorded here, to the extent that it can
	// be known in advance.  In the case of a SparseTensor, this field describes
	// the logical shape of the represented tensor (aka dense_shape).
	TensorShape          *framework.TensorShapeProto `protobuf:"bytes,3,opt,name=tensor_shape,json=tensorShape,proto3" json:"tensor_shape,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

Information about a Tensor necessary for feeding or retrieval.

func (*TensorInfo) Descriptor

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

func (*TensorInfo) GetCooSparse

func (m *TensorInfo) GetCooSparse() *TensorInfo_CooSparse

func (*TensorInfo) GetDtype

func (m *TensorInfo) GetDtype() framework.DataType

func (*TensorInfo) GetEncoding

func (m *TensorInfo) GetEncoding() isTensorInfo_Encoding

func (*TensorInfo) GetName

func (m *TensorInfo) GetName() string

func (*TensorInfo) GetTensorShape

func (m *TensorInfo) GetTensorShape() *framework.TensorShapeProto

func (*TensorInfo) ProtoMessage

func (*TensorInfo) ProtoMessage()

func (*TensorInfo) Reset

func (m *TensorInfo) Reset()

func (*TensorInfo) String

func (m *TensorInfo) String() string

func (*TensorInfo) XXX_DiscardUnknown

func (m *TensorInfo) XXX_DiscardUnknown()

func (*TensorInfo) XXX_Marshal

func (m *TensorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TensorInfo) XXX_Merge

func (m *TensorInfo) XXX_Merge(src proto.Message)

func (*TensorInfo) XXX_OneofWrappers

func (*TensorInfo) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*TensorInfo) XXX_Size

func (m *TensorInfo) XXX_Size() int

func (*TensorInfo) XXX_Unmarshal

func (m *TensorInfo) XXX_Unmarshal(b []byte) error

type TensorInfo_CooSparse

type TensorInfo_CooSparse struct {
	// The shape of the values Tensor is [?].  Its dtype must be the dtype of
	// the SparseTensor as a whole, given in the enclosing TensorInfo.
	ValuesTensorName string `protobuf:"bytes,1,opt,name=values_tensor_name,json=valuesTensorName,proto3" json:"values_tensor_name,omitempty"`
	// The indices Tensor must have dtype int64 and shape [?, ?].
	IndicesTensorName string `protobuf:"bytes,2,opt,name=indices_tensor_name,json=indicesTensorName,proto3" json:"indices_tensor_name,omitempty"`
	// The dynamic logical shape represented by the SparseTensor is recorded in
	// the Tensor referenced here.  It must have dtype int64 and shape [?].
	DenseShapeTensorName string   `protobuf:"bytes,3,opt,name=dense_shape_tensor_name,json=denseShapeTensorName,proto3" json:"dense_shape_tensor_name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

For sparse tensors, The COO encoding stores a triple of values, indices, and shape.

func (*TensorInfo_CooSparse) Descriptor

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

func (*TensorInfo_CooSparse) GetDenseShapeTensorName

func (m *TensorInfo_CooSparse) GetDenseShapeTensorName() string

func (*TensorInfo_CooSparse) GetIndicesTensorName

func (m *TensorInfo_CooSparse) GetIndicesTensorName() string

func (*TensorInfo_CooSparse) GetValuesTensorName

func (m *TensorInfo_CooSparse) GetValuesTensorName() string

func (*TensorInfo_CooSparse) ProtoMessage

func (*TensorInfo_CooSparse) ProtoMessage()

func (*TensorInfo_CooSparse) Reset

func (m *TensorInfo_CooSparse) Reset()

func (*TensorInfo_CooSparse) String

func (m *TensorInfo_CooSparse) String() string

func (*TensorInfo_CooSparse) XXX_DiscardUnknown

func (m *TensorInfo_CooSparse) XXX_DiscardUnknown()

func (*TensorInfo_CooSparse) XXX_Marshal

func (m *TensorInfo_CooSparse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TensorInfo_CooSparse) XXX_Merge

func (m *TensorInfo_CooSparse) XXX_Merge(src proto.Message)

func (*TensorInfo_CooSparse) XXX_Size

func (m *TensorInfo_CooSparse) XXX_Size() int

func (*TensorInfo_CooSparse) XXX_Unmarshal

func (m *TensorInfo_CooSparse) XXX_Unmarshal(b []byte) error

type TensorInfo_CooSparse_

type TensorInfo_CooSparse_ struct {
	CooSparse *TensorInfo_CooSparse `protobuf:"bytes,4,opt,name=coo_sparse,json=cooSparse,proto3,oneof"`
}

type TensorInfo_Name

type TensorInfo_Name struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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