Home
last modified time | relevance | path

Searched refs:pyval (Results 1 – 5 of 5) sorted by relevance

/external/tensorflow/tensorflow/python/ops/structured/
Dstructured_tensor.py824 def from_pyval(cls, pyval, typespec=None): argument
848 if isinstance(pyval, dict):
849 return cls._from_pydict(pyval, typespec)
850 elif isinstance(pyval, (list, tuple)):
852 rank = _pyval_find_struct_keys_and_depth(pyval, keys)
854 return cls._from_pylist_of_dict(pyval, keys, rank, typespec)
856 return cls._from_pylist_of_value(pyval, typespec)
858 return cls._from_pyscalar(pyval, typespec)
861 def _from_pydict(cls, pyval, typespec): argument
864 fields = dict((k, cls.from_pyval(v)) for (k, v) in pyval.items())
[all …]
Dstructured_tensor_test.py681 def testPyvalConversion(self, pyval, expected, type_spec=None): argument
683 actual = structured_tensor.StructuredTensor.from_pyval(pyval, type_spec)
687 self.assertEqual(actual.to_pyval(), pyval)
739 pyval=[{"a": [1, 2]}, {"b": [3, 4]}],
743 pyval={"a": 1},
749 pyval=[{"a": 1}],
755 pyval=[{"a": 1}],
761 pyval=0,
766 pyval={"a": [[1]]},
772 pyval=[1, 2],
[all …]
/external/tensorflow/tensorflow/compiler/xla/python/
Dxla_client.py282 def shape_from_pyval(pyval): argument
285 def convert(pyval): argument
286 if isinstance(pyval, tuple):
287 return Shape.tuple_shape(tuple(convert(elt) for elt in pyval))
289 return Shape.array_shape(pyval.dtype, np.shape(pyval))
291 return convert(pyval)
373 backend.buffer_from_pyval(pyval, device) for pyval, device in flat_args
Dxla_client_test.py445 pyval = np.array([[1., 2.]], np.float32)
446 local_buffer = self.backend.buffer_from_pyval(pyval)
/external/tensorflow/tensorflow/compiler/xla/python_api/
Dxla_shape.py99 def from_pyval(pyval): argument
100 return CreateShapeFromNumpy(pyval)