public static final class
StructuredValue.Builder
`StructuredValue` represents a dynamically typed value representing various data structures that are inspired by Python data structures typically used in TensorFlow functions as inputs and outputs. For example when saving a Layer there may be a `training` argument. If the user passes a boolean True/False, that switches between two concrete TensorFlow functions. In order to switch between them in the same way after loading the SavedModel, we need to represent "True" and "False". A more advanced example might be a function which takes a list of dictionaries mapping from strings to Tensors. In order to map from user-specified arguments `[{"a": tf.constant(1.)}, {"q": tf.constant(3.)}]` after load to the right saved TensorFlow function, we need to represent the nested structure and the strings, recording that we have a trace for anything matching `[{"a": tf.TensorSpec(None, tf.float32)}, {"q": tf.TensorSpec([], tf.float64)}]` as an example. Likewise functions may return nested structures of Tensors, for example returning a dictionary mapping from strings to Tensors. In order for the loaded function to return the same structure we need to serialize it. This is an ergonomic aid for working with loaded SavedModels, not a promise to serialize all possible function signatures. For example we do not expect to pickle generic Python objects, and ideally we'd stay language-agnostic.Protobuf type
tensorflow.StructuredValue
Public Methods
StructuredValue.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
|
StructuredValue |
build()
|
StructuredValue | |
StructuredValue.Builder |
clear()
|
StructuredValue.Builder |
clearBoolValue()
Represents a boolean value. |
StructuredValue.Builder |
clearBoundedTensorSpecValue()
Represents a value for tf.BoundedTensorSpec. |
StructuredValue.Builder |
clearDictValue()
Represents a dict `Value`. |
StructuredValue.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
|
StructuredValue.Builder |
clearFloat64Value()
Represents a double-precision floating-point value (a Python `float`). |
StructuredValue.Builder |
clearInt64Value()
Represents a signed integer value, limited to 64 bits. |
StructuredValue.Builder | |
StructuredValue.Builder |
clearListValue()
Represents a list of `Value`. |
StructuredValue.Builder |
clearNamedTupleValue()
Represents Python's namedtuple. |
StructuredValue.Builder |
clearNoneValue()
Represents None. |
StructuredValue.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
|
StructuredValue.Builder |
clearStringValue()
Represents a string of Unicode characters stored in a Python `str`. |
StructuredValue.Builder |
clearTensorDtypeValue()
Represents an enum value for dtype. |
StructuredValue.Builder |
clearTensorShapeValue()
Represents a TensorShape. |
StructuredValue.Builder |
clearTensorSpecValue()
Represents a value for tf.TensorSpec. |
StructuredValue.Builder |
clearTupleValue()
Represents a tuple of `Value`. |
StructuredValue.Builder |
clearTypeSpecValue()
Represents a value for tf.TypeSpec. |
StructuredValue.Builder |
clone()
|
boolean |
getBoolValue()
Represents a boolean value. |
BoundedTensorSpecProto |
getBoundedTensorSpecValue()
Represents a value for tf.BoundedTensorSpec. |
BoundedTensorSpecProto.Builder |
getBoundedTensorSpecValueBuilder()
Represents a value for tf.BoundedTensorSpec. |
BoundedTensorSpecProtoOrBuilder |
getBoundedTensorSpecValueOrBuilder()
Represents a value for tf.BoundedTensorSpec. |
StructuredValue | |
final static com.google.protobuf.Descriptors.Descriptor | |
com.google.protobuf.Descriptors.Descriptor | |
DictValue |
getDictValue()
Represents a dict `Value`. |
DictValue.Builder |
getDictValueBuilder()
Represents a dict `Value`. |
DictValueOrBuilder |
getDictValueOrBuilder()
Represents a dict `Value`. |
double |
getFloat64Value()
Represents a double-precision floating-point value (a Python `float`). |
long |
getInt64Value()
Represents a signed integer value, limited to 64 bits. |
StructuredValue.KindCase | |
ListValue |
getListValue()
Represents a list of `Value`. |
ListValue.Builder |
getListValueBuilder()
Represents a list of `Value`. |
ListValueOrBuilder |
getListValueOrBuilder()
Represents a list of `Value`. |
NamedTupleValue |
getNamedTupleValue()
Represents Python's namedtuple. |
NamedTupleValue.Builder |
getNamedTupleValueBuilder()
Represents Python's namedtuple. |
NamedTupleValueOrBuilder |
getNamedTupleValueOrBuilder()
Represents Python's namedtuple. |
NoneValue |
getNoneValue()
Represents None. |
NoneValue.Builder |
getNoneValueBuilder()
Represents None. |
NoneValueOrBuilder |
getNoneValueOrBuilder()
Represents None. |
String |
getStringValue()
Represents a string of Unicode characters stored in a Python `str`. |
com.google.protobuf.ByteString |
getStringValueBytes()
Represents a string of Unicode characters stored in a Python `str`. |
DataType |
getTensorDtypeValue()
Represents an enum value for dtype. |
int |
getTensorDtypeValueValue()
Represents an enum value for dtype. |
TensorShapeProto |
getTensorShapeValue()
Represents a TensorShape. |
TensorShapeProto.Builder |
getTensorShapeValueBuilder()
Represents a TensorShape. |
TensorShapeProtoOrBuilder |
getTensorShapeValueOrBuilder()
Represents a TensorShape. |
TensorSpecProto |
getTensorSpecValue()
Represents a value for tf.TensorSpec. |
TensorSpecProto.Builder |
getTensorSpecValueBuilder()
Represents a value for tf.TensorSpec. |
TensorSpecProtoOrBuilder |
getTensorSpecValueOrBuilder()
Represents a value for tf.TensorSpec. |
TupleValue |
getTupleValue()
Represents a tuple of `Value`. |
TupleValue.Builder |
getTupleValueBuilder()
Represents a tuple of `Value`. |
TupleValueOrBuilder |
getTupleValueOrBuilder()
Represents a tuple of `Value`. |
TypeSpecProto |
getTypeSpecValue()
Represents a value for tf.TypeSpec. |
TypeSpecProto.Builder |
getTypeSpecValueBuilder()
Represents a value for tf.TypeSpec. |
TypeSpecProtoOrBuilder |
getTypeSpecValueOrBuilder()
Represents a value for tf.TypeSpec. |
boolean |
hasBoundedTensorSpecValue()
Represents a value for tf.BoundedTensorSpec. |
boolean |
hasDictValue()
Represents a dict `Value`. |
boolean |
hasListValue()
Represents a list of `Value`. |
boolean |
hasNamedTupleValue()
Represents Python's namedtuple. |
boolean |
hasNoneValue()
Represents None. |
boolean |
hasTensorShapeValue()
Represents a TensorShape. |
boolean |
hasTensorSpecValue()
Represents a value for tf.TensorSpec. |
boolean |
hasTupleValue()
Represents a tuple of `Value`. |
boolean |
hasTypeSpecValue()
Represents a value for tf.TypeSpec. |
final boolean | |
StructuredValue.Builder |
mergeBoundedTensorSpecValue(BoundedTensorSpecProto value)
Represents a value for tf.BoundedTensorSpec. |
StructuredValue.Builder | |
StructuredValue.Builder |
mergeFrom(com.google.protobuf.Message other)
|
StructuredValue.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
StructuredValue.Builder | |
StructuredValue.Builder | |
StructuredValue.Builder | |
StructuredValue.Builder | |
StructuredValue.Builder | |
StructuredValue.Builder | |
StructuredValue.Builder | |
final StructuredValue.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
|
StructuredValue.Builder |
setBoolValue(boolean value)
Represents a boolean value. |
StructuredValue.Builder |