Home
last modified time | relevance | path

Searched refs:expected_shape (Results 1 – 25 of 62) sorted by relevance

123

/external/tensorflow/tensorflow/contrib/framework/python/framework/
Dtensor_util.py133 def _shape_tensor_compatible(expected_shape, actual_shape): argument
145 values=[expected_shape, actual_shape]) as scope:
148 math_ops.equal(expected_shape, -1),
149 math_ops.equal(expected_shape, actual_shape, 'equal'),
169 def _is_shape(expected_shape, actual_tensor, actual_shape=None): argument
182 is_rank = _is_rank(array_ops.size(expected_shape), actual_tensor)
185 shape_equal = _shape_tensor_compatible(expected_shape, actual_shape)
189 def _assert_shape_op(expected_shape, actual_tensor): argument
203 if (isinstance(expected_shape, tensor_shape.TensorShape)
204 and not expected_shape.is_fully_defined()):
[all …]
Dtensor_util_test.py83 def _assert_with_shape(self, tensor, expected_value, expected_shape, argument
91 " ".join([str(dim) for dim in expected_shape])))
104 self.assertIs(tensor, tensor_util.with_shape(expected_shape, tensor))
109 1, shape=expected_shape), tensor))
111 constant_op.constant(expected_shape), tensor)
118 np.ones(expected_shape)
/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_constant_value_op_test.py38 dict(pylist='x', expected_shape=()),
42 dict(pylist=[1, 2, 3], expected_shape=(3,)),
46 dict(pylist=[[1, 2, 3], [4], [5, 6]], expected_shape=(3, None)),
47 dict(pylist=[[1, 2, 3], [4, 5, 6], [7, 8, 9]], expected_shape=(3, None)),
53 expected_shape=(3, None, None)),
57 expected_shape=(3, None, 2)),
61 expected_shape=(3, None, 2)),
66 expected_shape=(3, None, 2)),
72 expected_shape=(2, None, None, None)),
77 expected_shape=(2, None, 2, 2)),
[all …]
Dragged_const_op_test.py39 dict(pylist=b'x', expected_shape=()),
43 dict(pylist=[1, 2, 3], expected_shape=(3,)),
47 dict(pylist=[[1, 2, 3], [4], [5, 6]], expected_shape=(3, None)),
48 dict(pylist=[[1, 2, 3], [4, 5, 6], [7, 8, 9]], expected_shape=(3, None)),
54 expected_shape=(3, None, None)),
58 expected_shape=(3, None, 2)),
62 expected_shape=(3, None, 2)),
67 expected_shape=(3, None, 2)),
73 expected_shape=(2, None, None, None)),
78 expected_shape=(2, None, 2, 2)),
[all …]
Dragged_expand_dims_op_test.py54 expected_shape=[1, None, None]),
58 expected_shape=[2, None, None]),
62 expected_shape=[2, None, 1]),
70 expected_shape=[1, 3, 2]),
75 expected_shape=[3, 1, 2]),
80 expected_shape=[3, 2, 1]),
89 expected_shape=[1, None, None, None, 2]),
94 expected_shape=[3, None, None, None, 2]),
99 expected_shape=[3, None, None, None, 2]),
104 expected_shape=[3, None, None, 1, 2]),
[all …]
Dragged_to_tensor_op_test.py102 expected_shape=None): argument
109 if expected_shape is not None:
111 self.assertAllEqual(dt_shape, expected_shape)
Dragged_stack_op_test.py157 expected_shape=[3, None, None]),
295 expected_shape=[3, None, 2, 2]),
325 expected_shape=None): argument
336 if expected_shape is not None:
337 self.assertEqual(stacked.shape.as_list(), expected_shape)
Dragged_concat_op_test.py90 expected_shape=[3, None]),
236 expected_shape=None): argument
241 if expected_shape is not None:
242 self.assertEqual(concatenated.shape.as_list(), expected_shape)
/external/tensorflow/tensorflow/python/kernel_tests/
Dsets_test.py179 expected_shape = [2, 2]
189 expected_shape,
200 expected_shape,
216 expected_shape = [2, 2]
226 expected_shape,
241 expected_shape = [1, 1]
251 expected_shape,
262 expected_shape,
273 expected_shape,
396 expected_shape = [4, 2, 2]
[all …]
Dedit_distance_op_test.py45 expected_shape, argument
51 self.assertEqual(edit_distance.get_shape(), expected_shape)
66 expected_shape = [
80 expected_shape=expected_shape,
92 expected_shape=expected_shape,
Dreduce_join_op_test.py181 expected_shape = []
182 self._testReduceJoin(input_array, expected_val, expected_shape, axis=None)
186 expected_shape = [2, 4]
187 self._testReduceJoin(input_array, expected_val, expected_shape, axis=[])
284 expected_shape = [1, 1]
286 constant_op.constant(input_array), expected_val, expected_shape,
291 expected_shape = [2, 4]
293 input_array, expected_val, expected_shape, keep_dims=True, axis=[])
Dgather_op_test.py73 expected_shape = data.shape[:axis] + data.shape[axis + 1:]
74 self.assertEqual(expected_shape, gather_t.get_shape())
90 expected_shape = data.shape[:axis] + (4,) + data.shape[axis + 1:]
91 self.assertEqual(expected_shape, gather_t.get_shape())
116 expected_shape = (params.shape[:axis] + indices.shape +
118 self.assertEqual(expected_shape, gather.shape)
119 self.assertEqual(expected_shape, gather_negative_axis.shape)
/external/tensorflow/tensorflow/core/kernels/
Dsparse_add_op_test.cc89 Tensor expected_shape(allocator(), DT_INT64, in TEST_F() local
91 test::FillValues<int64>(&expected_shape, shape); in TEST_F()
92 test::ExpectTensorEqual<int64>(expected_shape, *GetOutput(2)); in TEST_F()
138 Tensor expected_shape(allocator(), DT_INT64, \
140 test::FillValues<int64>(&expected_shape, shape); \
141 test::ExpectTensorEqual<int64>(expected_shape, *GetOutput(2)); \
194 Tensor expected_shape(allocator(), DT_INT64, \
196 test::FillValues<int64>(&expected_shape, shape); \
197 test::ExpectTensorEqual<int64>(expected_shape, *GetOutput(2)); \
Dsparse_reduce_sum_op_test.cc118 Tensor expected_shape(allocator(), DT_INT64, {1}); in TEST_F() local
119 test::FillValues<int64>(&expected_shape, {2}); in TEST_F()
120 test::ExpectTensorEqual<int64>(expected_shape, *GetOutput(2)); in TEST_F()
Dquantized_mul_op_test.cc42 float y_max_value, const std::vector<int64>& expected_shape, in TestMul() argument
82 Tensor expected_z_float(DT_FLOAT, TensorShape(expected_shape)); in TestMul()
129 std::vector<int64> expected_shape; in TestMulShape() local
131 expected_shape.push_back(dim); in TestMulShape()
134 y_min_value, y_max_value, expected_shape, expected_values, 256.0); in TestMulShape()
Dquantized_add_op_test.cc42 float y_max_value, const std::vector<int64>& expected_shape, in TestAdd() argument
82 Tensor expected_z_float(DT_FLOAT, TensorShape(expected_shape)); in TestAdd()
129 std::vector<int64> expected_shape; in TestAddShape() local
131 expected_shape.push_back(dim); in TestAddShape()
134 y_min_value, y_max_value, expected_shape, expected_values, 256.0); in TestAddShape()
/external/tensorflow/tensorflow/python/kernel_tests/linalg/
Dlinear_operator_block_diag_test.py35 def _block_diag_dense(expected_shape, blocks): argument
49 [batch_row_shape, [expected_shape[-2] - num_cols]], axis=-1)
114 expected_shape = list(build_info.shape)
118 block_diag_dense = _block_diag_dense(expected_shape, matrices)
122 expected_shape[:-2] + [expected_shape[-1], expected_shape[-1]])
/external/tensorflow/tensorflow/contrib/distributions/python/kernel_tests/
Dcauchy_test.py363 expected_shape = tensor_shape.TensorShape([n.eval()]).concatenate(
366 self.assertAllEqual(expected_shape, samples.shape)
367 self.assertAllEqual(expected_shape, sample_values.shape)
369 expected_shape = (
372 self.assertAllEqual(expected_shape, samples.shape)
373 self.assertAllEqual(expected_shape, sample_values.shape)
391 expected_shape = tensor_shape.TensorShape([n.eval()]).concatenate(
393 self.assertAllEqual(expected_shape, samples.shape)
394 self.assertAllEqual(expected_shape, sample_values.shape)
396 expected_shape = (
[all …]
Dhalf_normal_test.py255 expected_shape = tensor_shape.TensorShape([n.eval()]).concatenate(
257 self.assertAllEqual(expected_shape, sample.shape)
258 self.assertAllEqual(expected_shape, sample.eval().shape)
279 expected_shape = tensor_shape.TensorShape([n.eval()]).concatenate(
281 self.assertAllEqual(expected_shape, sample.shape)
282 self.assertAllEqual(expected_shape, sample.eval().shape)
/external/tensorflow/tensorflow/compiler/xla/service/interpreter/
Dexecutable.cc73 const auto& expected_shape = computation->parameter_instruction(i)->shape(); in ExecuteOnStream() local
75 if (!ShapeUtil::Equal(expected_shape, actual_shape)) { in ExecuteOnStream()
78 ShapeUtil::HumanString(expected_shape), in ExecuteOnStream()
/external/tensorflow/tensorflow/compiler/xla/service/gpu/
Dgpu_layout_assignment_test.cc361 Shape expected_shape = in TEST_F() local
364 op::Dot(op::ShapeWithLayout(expected_shape), in TEST_F()
365 op::ShapeWithLayout(expected_shape))); in TEST_F()
399 Shape expected_shape = ShapeUtil::MakeShapeWithLayout(F32, {3, 2}, {1, 0}); in TEST_F() local
401 op::Sort(op::ShapeWithLayout(expected_shape), in TEST_F()
402 op::ShapeWithLayout(expected_shape))); in TEST_F()
/external/tensorflow/tensorflow/python/keras/utils/
Dnp_utils_test.py40 for label, one_hot, expected_shape in zip(labels,
44 self.assertEqual(one_hot.shape, expected_shape)
/external/tensorflow/tensorflow/contrib/training/python/training/
Dsequence_queueing_state_saver.py178 def _check_shape(value, expected_shape): argument
195 if isinstance(expected_shape, tensor_shape.TensorShape):
196 expected_shape = expected_shape.as_list()
197 if isinstance(expected_shape, ops.Tensor):
198 expected_shape_value = tensor_util.constant_value(expected_shape)
200 expected_shape = [int(d) for d in expected_shape_value]
201 if isinstance(expected_shape, ops.Tensor):
202 value = _check_rank(value, array_ops.size(expected_shape))
204 value = _check_rank(value, len(expected_shape))
208 math_ops.equal(expected_shape, array_ops.shape(value))), [
[all …]
/external/tensorflow/tensorflow/c/kernels/
Dbitcast_op_test.cc38 TensorShape expected_shape, error::Code expected_code) { in TestBitcastOp() argument
72 ASSERT_EQ(expected_shape, ctx.mutable_output(0)->shape()) in TestBitcastOp()
/external/tensorflow/tensorflow/python/keras/layers/
Ddense_attention_test.py190 expected_shape = [1, 2, 4]
191 self.assertAllEqual(expected_shape, array_ops.shape(actual))
210 expected_shape = [1, 2, 4]
211 self.assertAllEqual(expected_shape, array_ops.shape(actual))

123