MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / from_value

Method from_value

tensorflow/python/data/ops/optional_ops.py:88–105  ·  view source on GitHub ↗

Returns an `Optional` that wraps the given value. Args: value: A value to wrap. The value must be convertible to `Tensor` or `CompositeTensor`. Returns: An `Optional` that wraps `value`.

(value)

Source from the content-addressed store, hash-verified

86
87 @staticmethod
88 def from_value(value):
89 """Returns an `Optional` that wraps the given value.
90
91 Args:
92 value: A value to wrap. The value must be convertible to `Tensor` or
93 `CompositeTensor`.
94
95 Returns:
96 An `Optional` that wraps `value`.
97 """
98 with ops.name_scope("optional") as scope:
99 with ops.name_scope("value"):
100 value_structure = structure.type_spec_from_value(value)
101 encoded_value = structure.to_tensor_list(value_structure, value)
102
103 return _OptionalImpl(
104 gen_dataset_ops.optional_from_value(encoded_value, name=scope),
105 value_structure)
106
107 @staticmethod
108 def none_from_structure(value_structure):

Callers 15

_SparseTensor_3x4x2Method · 0.45
_SparseTensor_3x3Method · 0.45
_SparseTensor_3x5Method · 0.45
testSparseShapeMethod · 0.45
_SparseTensor_3x4x2Method · 0.45
_testMatmulMethod · 0.45
_SparseTensor_3x50Method · 0.45
testInt32AndFloat32Method · 0.45
_SparseTensor_3x50Method · 0.45

Calls 2

_OptionalImplClass · 0.85
name_scopeMethod · 0.45

Tested by 15

_SparseTensor_3x4x2Method · 0.36
_SparseTensor_3x3Method · 0.36
_SparseTensor_3x5Method · 0.36
testSparseShapeMethod · 0.36
_SparseTensor_3x4x2Method · 0.36
_SparseTensor_3x50Method · 0.36
testInt32AndFloat32Method · 0.36
_SparseTensor_3x50Method · 0.36
_SparseTensor_5x6Method · 0.36