/external/tensorflow/tensorflow/cc/gradients/ |
D | array_grad_test.cc | 35 void RunTest(const Output& x, const TensorShape& x_shape, const Output& y, in RunTest() argument 40 scope_, {x}, {x_shape}, {y}, {y_shape}, &max_error))); in RunTest() 57 TensorShape x_shape({1, 2, 3}); in TEST_F() local 59 xs.push_back(Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape))); in TEST_F() 60 xs.push_back(Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape))); in TEST_F() 63 RunTest(xs, {x_shape, x_shape}, {y}, {y_shape}); in TEST_F() 67 TensorShape x_shape({1, 2, 3}); in TEST_F() local 69 xs.push_back(Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape))); in TEST_F() 70 xs.push_back(Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape))); in TEST_F() 73 RunTest(xs, {x_shape, x_shape}, {y}, {y_shape}); in TEST_F() [all …]
|
D | nn_grad_test.cc | 54 void RunTest(const Output& x, const TensorShape& x_shape, const Output& y, in RunTest() argument 58 scope_, {x}, {x_shape}, {y}, {y_shape}, &max_error))); in RunTest() 211 TensorShape x_shape({5, 2}); in TEST_F() local 213 auto x = Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape)); in TEST_F() 215 RunTest(x, x_shape, y, y_shape); in TEST_F() 237 TensorShape x_shape({1, 2, 2, 1}); in TEST_F() local 239 auto x = Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape)); in TEST_F() 244 Tensor x_init_value = Tensor(DT_FLOAT, x_shape); in TEST_F() 250 TensorShape x_shape({1, 2, 2, 1}); in TEST_F() local 252 auto x = Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape)); in TEST_F() [all …]
|
D | math_grad_test.cc | 602 TensorShape x_shape = shapes[0]; in TestMatMulGrad() local 606 Placeholder(root_, DataTypeToEnum<T>::v(), Placeholder::Shape(x_shape)); in TestMatMulGrad() 618 root_, {x, y}, {x_shape, y_shape}, {z}, {z_shape}, &max_error))); in TestMatMulGrad() 631 TensorShape x_shape; in RandMatMulShapes() local 634 x_shape = tx ? TensorShape({b, k, m}) : TensorShape({b, m, k}); in RandMatMulShapes() 637 x_shape = tx ? TensorShape({k, m}) : TensorShape({m, k}); in RandMatMulShapes() 639 shapes->push_back(x_shape); in RandMatMulShapes() 757 TensorShape x_shape({2, 3, 5, 7}); in TEST_F() local 758 auto x = Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape)); in TEST_F() 762 RunTest({x}, {x_shape}, {y}, {y_shape}); in TEST_F() [all …]
|
D | image_grad_test.cc | 81 TensorShape x_shape({1, 2, 2, 1}); in TestResizedShapeForType() local 82 Tensor x_data = MakeData<T>(x_shape); in TestResizedShapeForType() 114 TensorShape x_shape({1, 4, 6, 1}); in TestResizeToSmallerAndAlign() local 115 Tensor x_data = MakeData<X_T>(x_shape); in TestResizeToSmallerAndAlign() 129 TensorShape x_shape({1, 2, 3, 1}); in TestResizeToLargerAndAlign() local 130 Tensor x_data = MakeData<X_T>(x_shape); in TestResizeToLargerAndAlign() 211 void TestScaleAndTranslate(const TensorShape x_shape, const int out_height, in TestScaleAndTranslate() argument 215 Tensor x_data = MakeData<X_T>(x_shape); in TestScaleAndTranslate() 326 TensorShape x_shape({1, 4, 2, 1}); in TestCropAndResize() local 327 Tensor x_data = MakeData<X_T>(x_shape); in TestCropAndResize()
|
/external/tensorflow/tensorflow/python/ops/ |
D | nn_fused_batchnorm_test.py | 61 x_shape, argument 69 x_val = np.random.random_sample(x_shape).astype(x_dtype) 142 x_shape, argument 150 x_val = np.random.random_sample(x_shape).astype(x_dtype) 185 def _compute_gradient_error_float16(self, x, x32, x_shape, y, y32, y_shape): argument 207 x_init_val = np.random.random_sample(x_shape).astype(np.float16) 213 x, x_shape, y, y_shape, delta=1e-3, x_init_value=x_init_val) 215 x32, x_shape, y32, y_shape, delta=1e-3, x_init_value=x32_init_val) 223 x_shape, argument 232 x_val = np.random.random_sample(x_shape).astype(x_dtype) [all …]
|
D | gradient_checker.py | 57 def _compute_theoretical_jacobian(x, x_shape, x_data, dy, dy_shape, dx, argument 84 x_shape = tuple(x_shape) + (2,) 88 x_size = _product(x_shape) 89 x_val_size = _product(x_shape[1:]) # This is used for sparse gradients 135 def _compute_numeric_jacobian(x, x_shape, x_data, y, y_shape, delta, argument 169 x_size = _product(x_shape) * (2 if x.dtype.is_complex else 1) 212 x_shape, argument 230 assert(list(x_shape) == i_shape), "x_shape = %s, init_data shape = %s" % ( 231 x_shape, i_shape) 234 x_data = np.random.random_sample(x_shape).astype(t.as_numpy_dtype) [all …]
|
D | image_ops_test.py | 419 x_shape = [2, 2, 3] 421 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 425 y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape) 428 x = constant_op.constant(x_np, shape=x_shape) 434 x_shape = [2, 2, 3] 436 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 440 y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape) 443 x = constant_op.constant(x_np, shape=x_shape) 449 x_shape = [2, 1, 2, 3] 451 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) [all …]
|
D | nn_batchnorm_test.py | 76 x_shape = [3, 5, 4, 2] 78 x_val = np.random.random_sample(x_shape).astype(np.float32) 125 x_shape = [3, 5, 4, 5] 128 x_val = np.random.random_sample(x_shape).astype(np.float64) 151 all_shapes = [x_shape, param_shape, param_shape, param_shape, param_shape] 154 output, x_shape) 210 x_shape = [7, 5, 4, 6] 213 x_val = np.random.random_sample(x_shape).astype(np.float32) 218 backprop_val = np.random.random_sample(x_shape).astype(np.float32) 262 x_shape = (3, 5, 4, 2) [all …]
|
D | nn_test.py | 60 x_shape = [5, 17] 61 x_np = np.random.randint(0, 2, size=x_shape).astype(np.float32) 65 x_tf.set_shape(x_shape) 111 x_shape = [5, 10] 112 x_np = np.random.randn(*x_shape).astype(np.float32) 136 x_shape = [5, 10] 137 x_np = np.random.randn(*x_shape).astype(np.float32) 144 tol = x_shape[1] * 1e-3 149 def testGradient(self, x_shape): argument 150 x_np = np.random.randn(*x_shape).astype(np.float64) [all …]
|
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
D | reverse_op.cc | 37 const TensorShape x_shape = ctx->InputShape(0); in Compile() local 43 OP_REQUIRES(ctx, revd_shape.num_elements() == x_shape.dims(), in Compile() 47 x_shape.DebugString(), ".")); in Compile() 57 for (int d = 0; d < x_shape.dims(); ++d) { in Compile() 75 const TensorShape x_shape = ctx->InputShape(0); in Compile() local 81 OP_REQUIRES(ctx, axes_shape.num_elements() <= x_shape.dims(), in Compile() 85 x_shape.DebugString(), ".")); in Compile() 97 absl::InlinedVector<bool, 8> witnessed_axes(x_shape.dims(), false); in Compile() 101 ctx, (-x_shape.dims() <= axes[d]) && (axes[d] < x_shape.dims()), in Compile() 103 x_shape.dims(), ", ", x_shape.dims(), ").")); in Compile() [all …]
|
D | beta_op.cc | 39 const TensorShape& x_shape = ctx->InputShape(2); in Compile() local 46 if (a_shape.dims() > 0 && x_shape.dims() > 0) { in Compile() 47 OP_REQUIRES(ctx, a_shape == x_shape, in Compile() 50 a_shape.DebugString(), " vs. ", x_shape.DebugString())); in Compile() 52 if (b_shape.dims() > 0 && x_shape.dims() > 0) { in Compile() 53 OP_REQUIRES(ctx, b_shape == x_shape, in Compile() 56 b_shape.DebugString(), " vs. ", x_shape.DebugString())); in Compile() 61 if (x_shape.dims() > 0) merged_shape = x_shape; in Compile()
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | conv1d_transpose_test.py | 40 x_shape = [2, 6, 3] 47 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 68 x_shape = [2, 4, 3] 75 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 82 for n in xrange(x_shape[0]): 97 x_shape = [2, 4, 3] 104 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 116 for n in xrange(x_shape[0]): 135 x_shape = [2, 4, 3] 140 x_val = np.random.random_sample(x_shape).astype(np.float64) [all …]
|
D | conv2d_transpose_test.py | 45 x_shape = [2, 6, 4, 3] 51 x = constant_op.constant(1, shape=x_shape, name="x", dtype=dtype) 64 for n in xrange(x_shape[0]): 86 x_shape = [2, 6, 4, 3] 92 x = constant_op.constant(1, shape=x_shape, name="x", dtype=dtype) 98 for n in xrange(x_shape[0]): 122 x_shape = [2, 6, 4, 3] 128 x = constant_op.constant(1, shape=x_shape, name="x", dtype=dtype) 139 for n in xrange(x_shape[0]): 168 x_shape = [2, 6, 4, 3] [all …]
|
D | conv3d_transpose_test.py | 40 x_shape = [2, 5, 6, 4, 3] 47 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 67 for n in xrange(x_shape[0]): 90 x_shape = [2, 5, 6, 4, 3] 97 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 104 for n in xrange(x_shape[0]): 126 x_shape = [2, 2, 3, 4, 3] 131 x_value = np.random.random_sample(x_shape).astype(np.float64) 140 x_shape = [2, 5, 6, 4, 3] 145 1.0, shape=x_shape, name="x", dtype=dtypes.float32) [all …]
|
D | atrous_conv2d_test.py | 68 x_shape = [2, height, width, 2] 69 x = np.arange(np.prod(x_shape), dtype=np.float32).reshape(x_shape) 115 x_shape = [3, height, width, 2] 116 x = np.random.random_sample(x_shape).astype(np.float32) 143 x_shape = [2, 5, 6, 2] 150 x_val = np.random.random_sample(x_shape).astype(np.float32) 158 [x_shape, f_shape], 173 x_shape = [2, height, width, 2] 174 x = np.arange(np.prod(x_shape), dtype=np.float32).reshape(x_shape) 213 x_shape = [2, height, width, 2] [all …]
|
D | numerics_test.py | 37 x_shape = [5, 4] 38 x = np.random.random_sample(x_shape).astype(np.float32) 40 t = constant_op.constant(x, shape=x_shape, dtype=dtypes.float32) 46 x_shape = [5, 4] 47 x = np.random.random_sample(x_shape).astype(np.float32) 54 t = constant_op.constant(x, shape=x_shape, dtype=dtypes.float32) 62 t = constant_op.constant(x, shape=x_shape, dtype=dtypes.float32)
|
/external/tensorflow/tensorflow/core/tpu/kernels/xla/ |
D | inplace_ops.cc | 45 const TensorShape x_shape = ctx->InputShape(0); in Compile() local 53 OP_REQUIRES(ctx, (x_shape.dims() == v_shape.dims()), in Compile() 56 x_shape.DebugString(), in Compile() 67 for (int xi = 1; xi < x_shape.dims(); xi++) { in Compile() 105 const TensorShape x_shape = ctx->InputShape(0); in Compile() local 112 OP_REQUIRES(ctx, (x_shape.dims() == v_shape.dims()), in Compile() 115 x_shape.DebugString(), in Compile() 121 for (int i = 0; i < x_shape.dims() - 1; ++i) { in Compile() 127 for (int i = 1; i < x_shape.dims(); i++) { in Compile() 128 sizes.push_back(x_shape.dim_size(i)); in Compile()
|
/external/tensorflow/tensorflow/core/kernels/ |
D | betainc_op.cc | 49 const TensorShape& x_shape = x.shape(); in Compute() local 56 if (a_shape.dims() > 0 && x_shape.dims() > 0) { in Compute() 57 OP_REQUIRES(ctx, a_shape == x_shape, in Compute() 60 a_shape.DebugString(), " vs. ", x_shape.DebugString())); in Compute() 62 if (b_shape.dims() > 0 && x_shape.dims() > 0) { in Compute() 63 OP_REQUIRES(ctx, b_shape == x_shape, in Compute() 66 b_shape.DebugString(), " vs. ", x_shape.DebugString())); in Compute() 71 if (x_shape.dims() > 0) merged_shape = x_shape; in Compute() 76 if (a_shape == b_shape && a_shape == x_shape) { in Compute() 86 BCast x_shaper(BCast::FromShape(x_shape), merged_shape_vec); in Compute()
|
D | quantized_mul_op_test.cc | 38 void TestMul(const std::vector<int64>& x_shape, in TestMul() argument 46 Tensor x_float_tensor(DT_FLOAT, TensorShape(x_shape)); in TestMul() 87 void TestMulShape(const std::vector<int64>& x_shape, in TestMulShape() argument 89 const size_t x_num_elements = TensorShape(x_shape).num_elements(); in TestMulShape() 107 Tensor x_float_tensor(DT_FLOAT, TensorShape(x_shape)); in TestMulShape() 133 TestMul(x_shape, x_values, x_min_value, x_max_value, y_shape, y_values, in TestMulShape() 137 void TimeMul(const std::vector<int64>& x_shape, in TimeMul() argument 139 TestMulShape(x_shape, y_shape); in TimeMul() 143 Tensor x_quantized_tensor(DT_QUINT8, TensorShape(x_shape)); in TimeMul() 177 LOG(INFO) << "TimeMul: " << TensorShape(x_shape).DebugString() << " * " in TimeMul()
|
D | quantized_add_op_test.cc | 38 void TestAdd(const std::vector<int64>& x_shape, in TestAdd() argument 46 Tensor x_float_tensor(DT_FLOAT, TensorShape(x_shape)); in TestAdd() 87 void TestAddShape(const std::vector<int64>& x_shape, in TestAddShape() argument 89 const size_t x_num_elements = TensorShape(x_shape).num_elements(); in TestAddShape() 107 Tensor x_float_tensor(DT_FLOAT, TensorShape(x_shape)); in TestAddShape() 133 TestAdd(x_shape, x_values, x_min_value, x_max_value, y_shape, y_values, in TestAddShape() 137 void TimeAdd(const std::vector<int64>& x_shape, in TimeAdd() argument 139 TestAddShape(x_shape, y_shape); in TimeAdd() 143 Tensor x_quantized_tensor(DT_QUINT8, TensorShape(x_shape)); in TimeAdd() 177 LOG(INFO) << "TimeAdd: " << TensorShape(x_shape).DebugString() << " * " in TimeAdd()
|
/external/tensorflow/tensorflow/cc/framework/ |
D | gradient_checker_test.cc | 126 TensorShape x_shape({4, 3}); in TEST() local 130 auto x = Placeholder(scope, DT_DOUBLE, Placeholder::Shape(x_shape)); in TEST() 135 scope, {x}, {x_shape}, {z}, {z_shape}, &max_error))); in TEST() 142 TensorShape x_shape({5, 2}); in TEST() local 143 auto x = Placeholder(scope, DT_DOUBLE, Placeholder::Shape(x_shape)); in TEST() 150 scope, {x}, {x_shape}, y.output, {y_shape, y_shape}, &max_error))); in TEST() 157 TensorShape x_shape({1, 2, 3}); in TEST() local 159 xs.push_back(Placeholder(scope, DT_DOUBLE, Placeholder::Shape(x_shape))); in TEST() 160 xs.push_back(Placeholder(scope, DT_DOUBLE, Placeholder::Shape(x_shape))); in TEST() 165 scope, xs, {x_shape, x_shape}, {y}, {y_shape}, &max_error))); in TEST()
|
/external/tensorflow/tensorflow/compiler/xla/service/ |
D | triangular_solve_expander_test.cc | 84 auto x_shape = lx.shape(); in TEST_P() local 85 EXPECT_EQ(x_shape.dimensions_size(), 2); in TEST_P() 86 EXPECT_EQ(x_shape.dimensions(0), b.dim(0)); in TEST_P() 87 EXPECT_EQ(x_shape.dimensions(1), b.dim(1)); in TEST_P() 89 Array2D<float> x(x_shape.dimensions(0), x_shape.dimensions(1)); in TEST_P()
|
/external/tensorflow/tensorflow/compiler/tests/ |
D | conv3d_test.py | 76 x_shape = [2, 5, 6, 4, 3] 83 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 103 for n in xrange(x_shape[0]): 126 x_shape = [2, 5, 6, 4, 3] 133 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 140 for n in xrange(x_shape[0]): 164 x_shape = [2, 5, 6, 4, 3] 171 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 183 for n in xrange(x_shape[0]): 213 x_shape = [2, 3, 4, 3, 2] [all …]
|
D | image_ops_test.py | 122 x_shape = [1, 2, 2, 3] 124 x_np = np.array(x_data, dtype=np.float32).reshape(x_shape) / 255. 130 y_np = np.array(y_data, dtype=np.float32).reshape(x_shape) / 255. 135 x_shape = [2, 1, 2, 3] 137 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 140 y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape) 165 for x_shape in x_shapes: 166 x_np = np.random.rand(*x_shape) * 255. 176 x_shape = [2, 2, 3] 178 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) [all …]
|
/external/tensorflow/tensorflow/python/keras/utils/ |
D | kernelized_utils.py | 40 x_shape = x_matrix.shape 42 if y_shape[1] != x_shape[1]: # dimensions do not match. 45 'vs {}.'.format(y_shape[1], x_shape[1])) 50 array_ops.expand_dims(y_matrix, 0), [x_shape[0], 1, 1])
|