classe final pública StructuredValue
`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.
tensorflow.StructuredValue Classes aninhadas
| aula | 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. | |
| enumeração | StructuredValue.KindCase | ||
Constantes
| interno | BOOL_VALUE_FIELD_NUMBER | |
| interno | BOUNDED_TENSOR_SPEC_VALUE_FIELD_NUMBER | |
| interno | DICT_VALUE_FIELD_NUMBER | |
| interno | FLOAT64_VALUE_FIELD_NUMBER | |
| interno | INT64_VALUE_FIELD_NUMBER | |
| interno | LIST_VALUE_FIELD_NUMBER | |
| interno | NAMED_TUPLE_VALUE_FIELD_NUMBER | |
| interno | NONE_VALUE_FIELD_NUMBER | |
| interno | STRING_VALUE_FIELD_NUMBER | |
| interno | TENSOR_DTYPE_VALUE_FIELD_NUMBER | |
| interno | TENSOR_SHAPE_VALUE_FIELD_NUMBER | |
| interno | TENSOR_SPEC_VALUE_FIELD_NUMBER | |
| interno | TUPLE_VALUE_FIELD_NUMBER | |
| interno | TYPE_SPEC_VALUE_FIELD_NUMBER |
Métodos Públicos
| booleano | é igual (objeto obj) |
| booleano | getBoolValue () Represents a boolean value. |
| BoundedTensorSpecProto | getBoundedTensorSpecValue () Represents a value for tf.BoundedTensorSpec. |
| BoundedTensorSpecProtoOrBuilder | getBoundedTensorSpecValueOrBuilder () Represents a value for tf.BoundedTensorSpec. |
| Valor Estruturado estático | |
| Valor Estruturado | |
| final estático com.google.protobuf.Descriptors.Descriptor | |
| DictValue | getDictValue () Represents a dict `Value`. |
| DictValueOrBuilder | getDictValueOrBuilder () Represents a dict `Value`. |
| dobro | getFloat64Value () Represents a double-precision floating-point value (a Python `float`). |
| longo | getInt64Value () Represents a signed integer value, limited to 64 bits. |
| StructuredValue.KindCase | getKindCase () |
| ListaValor | getListValue () Represents a list of `Value`. |
| ListValueOrBuilder | getListValueOrBuilder () Represents a list of `Value`. |
| NamedTupleValue | getNamedTupleValue () Represents Python's namedtuple. |
| NamedTupleValueOrBuilder | getNamedTupleValueOrBuilder () Represents Python's namedtuple. |
| NenhumValor | getNoneValue () Represents None. |
| NoneValueOrBuilder | getNoneValueOrBuilder () Represents None. |
| interno | |
| Corda | 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`. |
| Tipo de dados | getTensorDtypeValue () Represents an enum value for dtype. |
| interno | getTensorDtypeValueValue () Represents an enum value for dtype. |
| TensorShapeProto | getTensorShapeValue () Represents a TensorShape. |
| TensorShapeProtoOrBuilder | getTensorShapeValueOrBuilder () Represents a TensorShape. |
| TensorSpecProto | getTensorSpecValue () Represents a value for tf.TensorSpec. |
| TensorSpecProtoOrBuilder | getTensorSpecValueOrBuilder () Represents a value for tf.TensorSpec. |
| TuplaValor | getTupleValue () Represents a tuple of `Value`. |
| TupleValueOrBuilder | getTupleValueOrBuilder () Represents a tuple of `Value`. |
| TypeSpecProto | getTypeSpecValue () Represents a value for tf.TypeSpec. |
| TypeSpecProtoOrBuilder | getTypeSpecValueOrBuilder () Represents a value for tf.TypeSpec. |
| final com.google.protobuf.UnknownFieldSet | |
| booleano | hasBoundedTensorSpecValue () Represents a value for tf.BoundedTensorSpec. |
| booleano | hasDictValue () Represents a dict `Value`. |
| booleano | hasListValue () Represents a list of `Value`. |
| booleano | hasNamedTupleValue () Represents Python's namedtuple. |
| booleano | hasNoneValue () Represents None. |
| booleano | hasTensorShapeValue () Represents a TensorShape. |
| booleano | hasTensorSpecValue () Represents a value for tf.TensorSpec. |
| booleano | hasTupleValue () Represents a tuple of `Value`. |
| booleano | hasTypeSpecValue () Represents a value for tf.TypeSpec. |
| interno | código hash () |
| booleano final | |
| StructuredValue.Builder estático | newBuilder (protótipo StructuredValue ) |
| StructuredValue.Builder estático | |
| StructuredValue.Builder | |
| Valor Estruturado estático | parseDelimitedFrom (entrada InputStream) |
| Valor Estruturado estático | parseDelimitedFrom (entrada InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
| Valor Estruturado estático | parseFrom (dados de ByteBuffer, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
| Valor Estruturado estático | parseFrom (entrada com.google.protobuf.CodedInputStream) |
| Valor Estruturado estático | parseFrom (byte[] dados, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
| Valor Estruturado estático | parseFrom (dados de ByteBuffer) |
| Valor Estruturado estático | parseFrom (entrada com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
| Valor Estruturado estático | parseFrom (dados com.google.protobuf.ByteString) |
| Valor Estruturado estático | parseFrom (entrada InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
| Valor Estruturado estático | parseFrom (dados com.google.protobuf.ByteString, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
| estático | analisador () |
| StructuredValue.Builder | |
| vazio | writeTo (saída com.google.protobuf.CodedOutputStream) |
Métodos herdados
Constantes
público estático final int BOOL_VALUE_FIELD_NUMBER
Valor Constante: 14
público estático final int BOUNDED_TENSOR_SPEC_VALUE_FIELD_NUMBER
Valor Constante: 35
público estático final int DICT_VALUE_FIELD_NUMBER
Valor Constante: 53
público estático final int FLOAT64_VALUE_FIELD_NUMBER
Valor Constante: 11
público estático final int INT64_VALUE_FIELD_NUMBER
Valor Constante: 12
público estático final int LIST_VALUE_FIELD_NUMBER
Valor Constante: 51
público estático final int NAMED_TUPLE_VALUE_FIELD_NUMBER
Valor Constante: 54
int final estático público NONE_VALUE_FIELD_NUMBER
Valor Constante: 1
int final estático público STRING_VALUE_FIELD_NUMBER
Valor Constante: 13
int final estático público TENSOR_DTYPE_VALUE_FIELD_NUMBER
Valor Constante: 32
público estático final int TENSOR_SHAPE_VALUE_FIELD_NUMBER
Valor Constante: 31
público estático final int TENSOR_SPEC_VALUE_FIELD_NUMBER
Valor Constante: 33
público estático final int TUPLE_VALUE_FIELD_NUMBER
Valor Constante: 52
público estático final int TYPE_SPEC_VALUE_FIELD_NUMBER
Valor Constante: 34
Métodos Públicos
booleano público é igual (Object obj)
getBoolValue booleano público ()
Represents a boolean value.
bool bool_value = 14; public BoundedTensorSpecProto getBoundedTensorSpecValue ()
Represents a value for tf.BoundedTensorSpec.
.tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; public BoundedTensorSpecProtoOrBuilder getBoundedTensorSpecValueOrBuilder ()
Represents a value for tf.BoundedTensorSpec.
.tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; final estático público com.google.protobuf.Descriptors.Descriptor getDescriptor ()
public DictValueOrBuildergetDictValueOrBuilder ( )
Represents a dict `Value`.
.tensorflow.DictValue dict_value = 53; público duplo getFloat64Value ()
Represents a double-precision floating-point value (a Python `float`).
double float64_value = 11; público longo getInt64Value ()
Represents a signed integer value, limited to 64 bits. Larger values from Python's arbitrary-precision integers are unsupported.
sint64 int64_value = 12; publicListValuegetListValue ( )
Represents a list of `Value`.
.tensorflow.ListValue list_value = 51; public ListValueOrBuildergetListValueOrBuilder ( )
Represents a list of `Value`.
.tensorflow.ListValue list_value = 51; público NamedTupleValue getNamedTupleValue ()
Represents Python's namedtuple.
.tensorflow.NamedTupleValue named_tuple_value = 54; public NamedTupleValueOrBuilder getNamedTupleValueOrBuilder ()
Represents Python's namedtuple.
.tensorflow.NamedTupleValue named_tuple_value = 54; public NoneValueOrBuildergetNoneValueOrBuilder ( )
Represents None.
.tensorflow.NoneValue none_value = 1; público getParserForType ()
público int getSerializedSize ()
String pública getStringValue ()
Represents a string of Unicode characters stored in a Python `str`. In Python 3, this is exactly what type `str` is. In Python 2, this is the UTF-8 encoding of the characters. For strings with ASCII characters only (as often used in TensorFlow code) there is effectively no difference between the language versions. The obsolescent `unicode` type of Python 2 is not supported here.
string string_value = 13; público com.google.protobuf.ByteString getStringValueBytes ()
Represents a string of Unicode characters stored in a Python `str`. In Python 3, this is exactly what type `str` is. In Python 2, this is the UTF-8 encoding of the characters. For strings with ASCII characters only (as often used in TensorFlow code) there is effectively no difference between the language versions. The obsolescent `unicode` type of Python 2 is not supported here.
string string_value = 13; tipo de dados público getTensorDtypeValue ()
Represents an enum value for dtype.
.tensorflow.DataType tensor_dtype_value = 32; público int getTensorDtypeValueValue ()
Represents an enum value for dtype.
.tensorflow.DataType tensor_dtype_value = 32; público TensorShapeProto getTensorShapeValue ()
Represents a TensorShape.
.tensorflow.TensorShapeProto tensor_shape_value = 31; público TensorShapeProtoOrBuilder getTensorShapeValueOrBuilder ()
Represents a TensorShape.
.tensorflow.TensorShapeProto tensor_shape_value = 31; público TensorSpecProto getTensorSpecValue ()
Represents a value for tf.TensorSpec.
.tensorflow.TensorSpecProto tensor_spec_value = 33; público TensorSpecProtoOrBuilder getTensorSpecValueOrBuilder ()
Represents a value for tf.TensorSpec.
.tensorflow.TensorSpecProto tensor_spec_value = 33; public TupleValue getTupleValue ()
Represents a tuple of `Value`.
.tensorflow.TupleValue tuple_value = 52; public TupleValueOrBuildergetTupleValueOrBuilder ( )
Represents a tuple of `Value`.
.tensorflow.TupleValue tuple_value = 52; public TypeSpecProto getTypeSpecValue ()
Represents a value for tf.TypeSpec.
.tensorflow.TypeSpecProto type_spec_value = 34; public TypeSpecProtoOrBuilder getTypeSpecValueOrBuilder ()
Represents a value for tf.TypeSpec.
.tensorflow.TypeSpecProto type_spec_value = 34; final público com.google.protobuf.UnknownFieldSet getUnknownFields ()
público booleano hasBoundedTensorSpecValue ()
Represents a value for tf.BoundedTensorSpec.
.tensorflow.BoundedTensorSpecProto bounded_tensor_spec_value = 35; hasDictValue booleano público ()
Represents a dict `Value`.
.tensorflow.DictValue dict_value = 53; hasListValue booleano público ()
Represents a list of `Value`.
.tensorflow.ListValue list_value = 51; hasNamedTupleValue booleano público ()
Represents Python's namedtuple.
.tensorflow.NamedTupleValue named_tuple_value = 54; hasNoneValue booleano público ()
Represents None.
.tensorflow.NoneValue none_value = 1; hasTensorShapeValue booleano público ()
Represents a TensorShape.
.tensorflow.TensorShapeProto tensor_shape_value = 31; hasTensorSpecValue booleano público ()
Represents a value for tf.TensorSpec.
.tensorflow.TensorSpecProto tensor_spec_value = 33; hasTupleValue booleano público ()
Represents a tuple of `Value`.
.tensorflow.TupleValue tuple_value = 52; hasTypeSpecValue booleano público ()
Represents a value for tf.TypeSpec.
.tensorflow.TypeSpecProto type_spec_value = 34; hashCode int público ()
público final booleano isInitialized ()
public static StructuredValue parseDelimitedFrom (entrada InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Lança
| IOException |
|---|
public static StructuredValue parseFrom (dados ByteBuffer, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Lança
| InvalidProtocolBufferException |
|---|
public static StructuredValue parseFrom (entrada com.google.protobuf.CodedInputStream)
Lança
| IOException |
|---|
public static StructuredValue parseFrom (byte[] dados, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Lança
| InvalidProtocolBufferException |
|---|
public static StructuredValue parseFrom (entrada com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Lança
| IOException |
|---|
public static StructuredValue parseFrom (dados com.google.protobuf.ByteString)
Lança
| InvalidProtocolBufferException |
|---|
public static StructuredValue parseFrom (entrada InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Lança
| IOException |
|---|
public static StructuredValue parseFrom (dados com.google.protobuf.ByteString, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Lança
| InvalidProtocolBufferException |
|---|
estática pública analisador ()
public void writeTo (saída com.google.protobuf.CodedOutputStream)
Lança
| IOException |
|---|