提交 55f6b6ff 编写于 作者: D David Soergel 提交者: TensorFlower Gardener

Add explicit SparseTensor support to SignatureDef.

PiperOrigin-RevId: 157860466
上级 79099d67
......@@ -202,8 +202,34 @@ message CollectionDef {
// Information about a Tensor necessary for feeding or retrieval.
message TensorInfo {
string name = 1;
// For sparse tensors, The COO encoding stores a triple of values, indices,
// and shape.
message CooSparse {
// The shape of the values Tensor is [?]. Its dtype must be the dtype of
// the SparseTensor as a whole, given in the enclosing TensorInfo.
string values_tensor_name = 1;
// The indices Tensor must have dtype int64 and shape [?, ?].
string indices_tensor_name = 2;
// The dynamic logical shape represented by the SparseTensor is recorded in
// the Tensor referenced here. It must have dtype int64 and shape [?].
string dense_shape_tensor_name = 3;
}
oneof encoding {
// For dense `Tensor`s, the name of the tensor in the graph.
string name = 1;
// There are many possible encodings of sparse matrices
// (https://en.wikipedia.org/wiki/Sparse_matrix). Currently, TensorFlow
// uses only the COO encoding. This is supported and documented in the
// SparseTensor Python class.
CooSparse coo_sparse = 4;
}
DataType dtype = 2;
// 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).
TensorShapeProto tensor_shape = 3;
}
......
path: "tensorflow.TensorInfo.CooSparse"
tf_class {
is_instance: "<class \'tensorflow.core.protobuf.meta_graph_pb2.CooSparse\'>"
is_instance: "<type \'google.protobuf.pyext._message.CMessage\'>"
member {
name: "DENSE_SHAPE_TENSOR_NAME_FIELD_NUMBER"
mtype: "<type \'int\'>"
}
member {
name: "DESCRIPTOR"
mtype: "<type \'google.protobuf.pyext._message.MessageDescriptor\'>"
}
member {
name: "Extensions"
mtype: "<type \'getset_descriptor\'>"
}
member {
name: "INDICES_TENSOR_NAME_FIELD_NUMBER"
mtype: "<type \'int\'>"
}
member {
name: "VALUES_TENSOR_NAME_FIELD_NUMBER"
mtype: "<type \'int\'>"
}
member_method {
name: "ByteSize"
}
member_method {
name: "Clear"
}
member_method {
name: "ClearExtension"
}
member_method {
name: "ClearField"
}
member_method {
name: "CopyFrom"
}
member_method {
name: "DiscardUnknownFields"
}
member_method {
name: "FindInitializationErrors"
}
member_method {
name: "FromString"
}
member_method {
name: "HasExtension"
}
member_method {
name: "HasField"
}
member_method {
name: "IsInitialized"
}
member_method {
name: "ListFields"
}
member_method {
name: "MergeFrom"
}
member_method {
name: "MergeFromString"
}
member_method {
name: "ParseFromString"
}
member_method {
name: "RegisterExtension"
}
member_method {
name: "SerializePartialToString"
}
member_method {
name: "SerializeToString"
}
member_method {
name: "SetInParent"
}
member_method {
name: "WhichOneof"
}
member_method {
name: "__init__"
}
}
......@@ -2,6 +2,14 @@ path: "tensorflow.TensorInfo"
tf_class {
is_instance: "<class \'tensorflow.core.protobuf.meta_graph_pb2.TensorInfo\'>"
is_instance: "<type \'google.protobuf.pyext._message.CMessage\'>"
member {
name: "COO_SPARSE_FIELD_NUMBER"
mtype: "<type \'int\'>"
}
member {
name: "CooSparse"
mtype: "<class \'google.protobuf.pyext.cpp_message.GeneratedProtocolMessageType\'>"
}
member {
name: "DESCRIPTOR"
mtype: "<type \'google.protobuf.pyext._message.MessageDescriptor\'>"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册