Home
last modified time | relevance | path

Searched refs:dtype (Results 1 – 25 of 3186) sorted by relevance

12345678910>>...128

/external/tensorflow/tensorflow/compiler/tests/
Dbinary_ops_test.py53 pa = array_ops.placeholder(dtypes.as_dtype(a.dtype), a.shape, name="a")
54 pb = array_ops.placeholder(dtypes.as_dtype(b.dtype), b.shape, name="b")
60 rtol = 1e-15 if a.dtype == np.float64 else 1e-3
62 atol = 1e-15 if a.dtype == np.float64 else 1e-6
77 for dtype in self.float_types:
78 if dtype == dtypes.bfloat16.as_numpy_dtype:
87 np.array([[[[-1, 2.00009999], [-3, b]]]], dtype=dtype),
88 np.array([[[[a, 2], [-3.00009, 4]]]], dtype=dtype),
89 expected=np.array([[[[False, True], [True, False]]]], dtype=dtype))
93 np.array([3, 3, -1.5, -8, 44], dtype=dtype),
[all …]
Dunary_ops_test.py73 dtypes.as_dtype(inp.dtype), inp.shape, name="a")
77 self.assertEqual(output.dtype, expected.dtype)
101 for dtype in self.numeric_types - {np.int8, np.uint8}:
103 array_ops.diag, np.array([1, 2, 3, 4], dtype=dtype),
106 dtype=dtype))
109 np.arange(36).reshape([2, 3, 2, 3]).astype(dtype),
110 np.array([[0, 7, 14], [21, 28, 35]], dtype=dtype))
112 array_ops.diag, np.array([[1, 2], [3, 4]], dtype=dtype),
116 dtype=dtype))
120 np.array([[-1, 1]], dtype=dtype),
[all …]
Dternary_ops_test.py39 pa = array_ops.placeholder(dtypes.as_dtype(a.dtype), a.shape, name="a")
40 pb = array_ops.placeholder(dtypes.as_dtype(b.dtype), b.shape, name="b")
41 pc = array_ops.placeholder(dtypes.as_dtype(c.dtype), c.shape, name="c")
54 expected = np.linspace(start, end, num, dtype=np.float32)
72 expected=np.array([1], dtype=np.int32))
78 expected=np.array([1, 3, 5], dtype=np.int32))
81 for dtype in self.numeric_types:
85 np.array(2, dtype=dtype),
86 np.array(7, dtype=dtype),
87 expected=np.array(7, dtype=dtype))
[all …]
Dnary_ops_test.py38 array_ops.placeholder(dtypes.as_dtype(arg.dtype), arg.shape)
58 [np.array([[1, 2, 3]], dtype=np.float32)],
59 expected=np.array([[1, 2, 3]], dtype=np.float32))
62 [np.array([1, 2], dtype=np.float32),
63 np.array([10, 20], dtype=np.float32)],
64 expected=np.array([11, 22], dtype=np.float32))
66 [np.array([-4], dtype=np.float32),
67 np.array([10], dtype=np.float32),
68 np.array([42], dtype=np.float32)],
69 expected=np.array([48], dtype=np.float32))
[all …]
Dsegment_reduction_ops_test.py37 d = array_ops.placeholder(data.dtype, shape=data.shape)
41 i = array_ops.placeholder(indices.dtype, shape=indices.shape)
61 for dtype in self.numeric_types:
66 dtype=dtype),
68 np.array([0, 1, 2, 3, 4, 5], dtype=dtype), 2, 4))
71 for dtype in self.numeric_types:
73 np.array([1, 3, 2, 9], dtype=dtype),
75 np.array([0, 1, 2, 3, 4, 5], dtype=dtype),
76 np.array([3, 0, 2, 1, 3, 3], dtype=np.int32), 4))
79 for dtype in self.numeric_types:
[all …]
Ddynamic_slice_ops_test.py36 array_ops.placeholder(dtypes.as_dtype(arg.dtype), arg.shape)
45 for dtype in self.numeric_types:
48 np.array([], dtype=dtype),
49 np.array([], dtype=dtype),
50 np.array([0], dtype=np.int32)
52 expected=np.array([], dtype=dtype))
56 np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], dtype=dtype),
57 np.array([-1, -2, -3], dtype=dtype),
58 np.array([6], dtype=np.int32)
60 expected=np.array([1, 2, 3, 4, 5, 6, -1, -2, -3, 10], dtype=dtype))
[all …]
Dnullary_ops_test.py46 for dtype in self.numeric_types:
48 dtype(42),
49 np.array([], dtype=dtype),
50 np.array([1, 2], dtype=dtype),
51 np.array([7, 7, 7, 7, 7], dtype=dtype),
52 np.array([[1, 2, 3], [4, 5, 6]], dtype=dtype),
54 dtype=dtype),
55 np.array([[[]], [[]]], dtype=dtype),
56 np.array([[[[1]]]], dtype=dtype),
62 for dtype in self.complex_types:
[all …]
Dftrl_test.py34 def initVariableAndGradient(self, dtype): argument
35 var0 = resource_variable_ops.ResourceVariable([0.0, 0.0], dtype=dtype)
36 var1 = resource_variable_ops.ResourceVariable([0.0, 0.0], dtype=dtype)
37 grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
38 grads1 = constant_op.constant([0.02, 0.04], dtype=dtype)
42 def equivAdagradTest_FtrlPart(self, steps, dtype): argument
43 var0, var1, grads0, grads1 = self.initVariableAndGradient(dtype)
62 def equivAdagradTest_AdagradPart(self, steps, dtype): argument
63 var0, var1, grads0, grads1 = self.initVariableAndGradient(dtype)
77 def equivGradientDescentTest_FtrlPart(self, steps, dtype): argument
[all …]
Dvariable_ops_test.py46 for dtype in self.numeric_types:
48 zeros = np.zeros([3, 0], dtype=dtype)
50 p = array_ops.placeholder(dtype)
59 for dtype in self.numeric_types:
60 init = np.array([[1, 2j], [3, 4]]).astype(dtype)
64 p = array_ops.placeholder(dtype)
69 np.array([[2, 1 + 2j], [4, 5]]).astype(dtype), sess.run(y, {p: 1}))
72 for dtype in self.numeric_types:
74 11]]).astype(dtype)
80 np.array([8j, 9, 10, 11]).astype(dtype), self.evaluate(x))
[all …]
Dadagrad_da_test.py35 for dtype in self.float_types:
38 0, dtype=dtypes.int64)
39 var0 = resource_variable_ops.ResourceVariable([0.0, 0.0], dtype=dtype)
40 var1 = resource_variable_ops.ResourceVariable([0.0, 0.0], dtype=dtype)
41 grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
42 grads1 = constant_op.constant([0.01, 0.02], dtype=dtype)
71 for dtype in self.float_types:
74 0, dtype=dtypes.int64)
75 var0 = resource_variable_ops.ResourceVariable([1.0, 2.0], dtype=dtype)
76 var1 = resource_variable_ops.ResourceVariable([4.0, 3.0], dtype=dtype)
[all …]
Deinsum_op_test.py38 dtypes.as_dtype(inp.dtype), inp.shape, name='a')
41 self.assertEqual(output.dtype, expected.dtype)
49 pa = array_ops.placeholder(dtypes.as_dtype(a.dtype), a.shape, name='a')
50 pb = array_ops.placeholder(dtypes.as_dtype(b.dtype), b.shape, name='b')
56 for dtype in self.float_types:
59 np.array([[-0.25]], dtype=dtype),
60 np.array([[8]], dtype=dtype),
61 expected=np.array([[-2]], dtype=dtype))
64 for dtype in self.float_types:
67 np.array([[[1, 3], [2, 5], [6, 8]]], dtype=dtype),
[all …]
Dxla_ops_test.py47 array_ops.placeholder(dtypes.as_dtype(arg.dtype), arg.shape)
58 for dtype in self.numeric_types:
61 args=(np.array([1, 2, 3], dtype=dtype),
62 np.array([4, 5, 6], dtype=dtype)),
63 expected=np.array([5, 7, 9], dtype=dtype))
67 args=(np.array([[1, 2], [3, 4]], dtype=dtype),
68 np.array([7, 11], dtype=dtype)),
69 expected=np.array([[8, 9], [14, 15]], dtype=dtype))
73 args=(np.array([[1, 2], [3, 4]], dtype=dtype),
74 np.array([7, 11], dtype=dtype)),
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Dsets_test.py40 def _values(values, dtype): argument
43 dtype=(np.unicode if (dtype == dtypes.string) else dtype.as_numpy_dtype))
46 def _constant(values, dtype): argument
47 return constant_op.constant(_values(values, dtype), dtype=dtype)
50 def _dense_to_sparse(dense, dtype): argument
62 values.append(str(cell) if dtype == dtypes.string else cell)
67 constant_op.constant(values, dtype),
75 for dtype in _DTYPES:
76 self._test_set_size_2d(dtype)
78 def _test_set_size_2d(self, dtype): argument
[all …]
Done_hot_op_test.py36 dtype=None, argument
41 array_ops.one_hot(dtype=dtype, **inputs)
43 ans = array_ops.one_hot(dtype=dtype, **inputs)
47 if dtype:
48 self.assertEqual(tf_ans.dtype, dtype)
58 def _testBasic(self, dtype): argument
59 indices = np.asarray([0, 2, -1, 1], dtype=np.int64)
61 on_value = np.asarray(1.0, dtype=dtype)
62 off_value = np.asarray(-1.0, dtype=dtype)
67 dtype=dtype)
[all …]
/external/tensorflow/tensorflow/python/ops/signal/
Dwindow_ops.py35 def _check_params(window_length, dtype): argument
49 if not dtype.is_floating:
50 raise ValueError('dtype must be a floating point type. Found %s' % dtype)
51 window_length = ops.convert_to_tensor(window_length, dtype=dtypes.int32)
58 def kaiser_window(window_length, beta=12., dtype=dtypes.float32, name=None): argument
74 window_length = _check_params(window_length, dtype)
77 return array_ops.ones([1], dtype=dtype)
80 math_ops.cast(window_length, dtype=dtypes.float32) - 1.0) / 2.0
82 dtype=dtypes.float32)
84 arg = math_ops.cast(arg, dtype=dtype)
[all …]
/external/tensorflow/tensorflow/python/keras/optimizer_v2/
Dftrl_test.py39 for dtype in [dtypes.float32]:
42 var0 = variables.Variable([0.0, 0.0], dtype=dtype)
43 var1 = variables.Variable([0.0, 0.0], dtype=dtype)
45 var0 = variables.Variable([0.0, 0.0], dtype=dtype)
46 var1 = variables.Variable([0.0, 0.0], dtype=dtype)
47 grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
48 grads1 = constant_op.constant([0.01, 0.02], dtype=dtype)
79 for dtype in [dtypes.half, dtypes.float32]:
81 var0 = variables.Variable([1.0, 2.0], dtype=dtype)
82 var1 = variables.Variable([4.0, 3.0], dtype=dtype)
[all …]
Dgradient_descent_test.py44 for dtype in [dtypes.half, dtypes.float32, dtypes.float64]:
45 var0 = variables.Variable([1.0, 2.0], dtype=dtype)
46 var1 = variables.Variable([3.0, 4.0], dtype=dtype)
47 grads0 = constant_op.constant([0.1, 0.1], dtype=dtype)
48 grads1 = constant_op.constant([0.01, 0.01], dtype=dtype)
60 def _test_basic_sgd_with_learning_rate_decay(self, sgd, dtype): argument
61 var0 = variables.Variable([1.0, 2.0], dtype=dtype)
62 var1 = variables.Variable([3.0, 4.0], dtype=dtype)
63 grads0 = constant_op.constant([0.1, 0.1], dtype=dtype)
64 grads1 = constant_op.constant([0.01, 0.01], dtype=dtype)
[all …]
Dadagrad_test.py75 for dtype in _DATA_TYPES:
76 var0_np = np.array([1.0, 2.0], dtype=dtype.as_numpy_dtype)
77 var1_np = np.array([3.0, 4.0], dtype=dtype.as_numpy_dtype)
78 grads0_np = np.array([0.1, 0.1], dtype=dtype.as_numpy_dtype)
79 grads1_np = np.array([0.01, 0.01], dtype=dtype.as_numpy_dtype)
91 accum0_np = np.array([0.1, 0.1], dtype=dtype.as_numpy_dtype)
92 accum1_np = np.array([0.1, 0.1], dtype=dtype.as_numpy_dtype)
126 for dtype in _DATA_TYPES:
127 var0_np = np.array([1.0, 2.0], dtype=dtype.as_numpy_dtype)
128 var1_np = np.array([3.0, 4.0], dtype=dtype.as_numpy_dtype)
[all …]
/external/tensorflow/tensorflow/python/training/
Dftrl_test.py41 for dtype in [dtypes.half, dtypes.float32]:
45 dtype=dtype)
47 dtype=dtype)
49 var0 = variables.Variable([0.0, 0.0], dtype=dtype)
50 var1 = variables.Variable([0.0, 0.0], dtype=dtype)
51 grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
52 grads1 = constant_op.constant([0.01, 0.02], dtype=dtype)
84 for dtype in [dtypes.half, dtypes.float32]:
86 var0 = variables.Variable([1.0, 2.0], dtype=dtype)
87 var1 = variables.Variable([4.0, 3.0], dtype=dtype)
[all …]
Dgradient_descent_test.py39 for dtype in [dtypes.half, dtypes.float32, dtypes.float64]:
42 var0 = variables.Variable([1.0, 2.0], dtype=dtype)
43 var1 = variables.Variable([3.0, 4.0], dtype=dtype)
44 grads0 = constant_op.constant([0.1, 0.1], dtype=dtype)
45 grads1 = constant_op.constant([0.01, 0.01], dtype=dtype)
63 for dtype in [dtypes.half, dtypes.float32, dtypes.float64]:
66 var0 = resource_variable_ops.ResourceVariable([1.0, 2.0], dtype=dtype)
67 var1 = resource_variable_ops.ResourceVariable([3.0, 4.0], dtype=dtype)
68 grads0 = constant_op.constant([0.1, 0.1], dtype=dtype)
69 grads1 = constant_op.constant([0.01, 0.01], dtype=dtype)
[all …]
Dadagrad_da_test.py38 for dtype in [dtypes.float64, dtypes.float32]:
40 global_step = variables.Variable(0, dtype=dtypes.int64)
42 var0 = resource_variable_ops.ResourceVariable([0.0, 0.0], dtype=dtype)
43 var1 = resource_variable_ops.ResourceVariable([0.0, 0.0], dtype=dtype)
45 var0 = variables.Variable([0.0, 0.0], dtype=dtype)
46 var1 = variables.Variable([0.0, 0.0], dtype=dtype)
47 grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
48 grads1 = constant_op.constant([0.01, 0.02], dtype=dtype)
86 for dtype in [dtypes.float32, dtypes.float64]:
88 var0 = resource_variable_ops.ResourceVariable([[1.0, 2.0]], dtype=dtype)
[all …]
/external/tensorflow/tensorflow/python/ops/
Dmath_grad_test.py73 def _testGrad(self, shape, dtype=None, max_error=None, bias=None, sigma=None): argument
75 if dtype in (dtypes.complex64, dtypes.complex128):
84 shape, bias=bias), dtype=dtype)
96 [3, 3], dtype=dtypes.float32, max_error=2e-5, bias=0.1, sigma=1.0)
98 [3, 3], dtype=dtypes.complex64, max_error=2e-5, bias=0.1, sigma=1.0)
102 [3, 3], dtype=dtypes.float32, max_error=100.0, bias=0.0, sigma=0.1)
104 [3, 3], dtype=dtypes.complex64, max_error=100.0, bias=0.0, sigma=0.1)
111 inputs = constant_op.constant([1.0], dtype=dtypes.float32)
119 inputs = constant_op.constant([1.0], dtype=dtypes.float32)
130 inputs = constant_op.constant([1.0, 2.0, 3.0, 4.0], dtype=dtypes.float32)
[all …]
Dinit_ops.py58 def __call__(self, shape, dtype=None, partition_info=None): argument
108 def __init__(self, dtype=dtypes.float32): argument
109 self.dtype = dtypes.as_dtype(dtype)
111 def __call__(self, shape, dtype=None, partition_info=None): argument
112 if dtype is None:
113 dtype = self.dtype
114 return array_ops.zeros(shape, dtype)
117 return {"dtype": self.dtype.name}
128 def __init__(self, dtype=dtypes.float32): argument
129 self.dtype = dtypes.as_dtype(dtype)
[all …]
Dinit_ops_v2.py52 def __call__(self, shape, dtype=None, **kwargs): argument
136 def __call__(self, shape, dtype=dtypes.float32, **kwargs): argument
149 dtype = dtypes.as_dtype(dtype)
150 if not dtype.is_numpy_compatible or dtype == dtypes.string:
151 raise ValueError("Expected numeric or boolean dtype, got %s." % dtype)
154 return array_ops.zeros(shape, dtype)
182 def __call__(self, shape, dtype=dtypes.float32, **kwargs): argument
195 dtype = dtypes.as_dtype(dtype)
196 if not dtype.is_numpy_compatible or dtype == dtypes.string:
197 raise ValueError("Expected numeric or boolean dtype, got %s." % dtype)
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/boosted_trees/
Dtraining_ops_test.py50 feature1_nodes = np.array([0], dtype=np.int32)
51 feature1_gains = np.array([7.62], dtype=np.float32)
52 feature1_thresholds = np.array([52], dtype=np.int32)
53 feature1_left_node_contribs = np.array([[-4.375]], dtype=np.float32)
54 feature1_right_node_contribs = np.array([[7.143]], dtype=np.float32)
56 feature2_nodes = np.array([0], dtype=np.int32)
57 feature2_gains = np.array([0.63], dtype=np.float32)
58 feature2_thresholds = np.array([23], dtype=np.int32)
59 feature2_left_node_contribs = np.array([[-0.6]], dtype=np.float32)
60 feature2_right_node_contribs = np.array([[0.24]], dtype=np.float32)
[all …]

12345678910>>...128