/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 | 580 TensorShape x_shape = shapes[0]; in TestMatMulGrad() local 584 Placeholder(root_, DataTypeToEnum<T>::v(), Placeholder::Shape(x_shape)); in TestMatMulGrad() 596 root_, {x, y}, {x_shape, y_shape}, {z}, {z_shape}, &max_error))); in TestMatMulGrad() 609 TensorShape x_shape; in RandMatMulShapes() local 612 x_shape = tx ? TensorShape({b, k, m}) : TensorShape({b, m, k}); in RandMatMulShapes() 615 x_shape = tx ? TensorShape({k, m}) : TensorShape({m, k}); in RandMatMulShapes() 617 shapes->push_back(x_shape); in RandMatMulShapes() 735 TensorShape x_shape({2, 3, 5, 7}); in TEST_F() local 736 auto x = Placeholder(scope_, DT_FLOAT, Placeholder::Shape(x_shape)); in TEST_F() 740 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 | 57 x_shape, argument 64 x_val = np.random.random_sample(x_shape).astype(x_dtype) 109 x_shape, argument 116 x_val = np.random.random_sample(x_shape).astype(x_dtype) 144 def _compute_gradient_error_float16(self, x, x32, x_shape, y, y32, y_shape): argument 166 x_init_val = np.random.random_sample(x_shape).astype(np.float16) 172 x, x_shape, y, y_shape, delta=1e-3, x_init_value=x_init_val) 174 x32, x_shape, y32, y_shape, delta=1e-3, x_init_value=x32_init_val) 182 x_shape, argument 190 x_val = np.random.random_sample(x_shape).astype(x_dtype) [all …]
|
D | gradient_checker.py | 56 def _compute_theoretical_jacobian(x, x_shape, x_data, dy, dy_shape, dx, argument 83 x_shape = tuple(x_shape) + (2,) 87 x_size = _product(x_shape) 88 x_val_size = _product(x_shape[1:]) # This is used for sparse gradients 134 def _compute_numeric_jacobian(x, x_shape, x_data, y, y_shape, delta, argument 168 x_size = _product(x_shape) * (2 if x.dtype.is_complex else 1) 211 x_shape, argument 229 assert(list(x_shape) == i_shape), "x_shape = %s, init_data shape = %s" % ( 230 x_shape, i_shape) 233 x_data = np.random.random_sample(x_shape).astype(t.as_numpy_dtype) [all …]
|
D | image_ops_test.py | 359 x_shape = [2, 2, 3] 361 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 365 y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape) 368 x = constant_op.constant(x_np, shape=x_shape) 374 x_shape = [2, 2, 3] 376 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 380 y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape) 383 x = constant_op.constant(x_np, shape=x_shape) 389 x_shape = [2, 1, 2, 3] 391 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 | 56 x_shape = [5, 17] 57 x_np = np.random.randint(0, 2, size=x_shape).astype(np.float32) 61 x_tf.set_shape(x_shape) 107 x_shape = [5, 10] 108 x_np = np.random.randn(*x_shape).astype(np.float32) 133 def testGradient(self, x_shape): argument 134 x_np = np.random.randn(*x_shape).astype(np.float64) 138 err = gradient_checker.compute_gradient_error(x_tf, x_shape, y_tf, 139 x_shape) 155 x_shape = [5, 10] [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 …]
|
/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 | 44 x_shape = [2, 6, 4, 3] 51 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 64 for n in xrange(x_shape[0]): 82 x_shape = [2, 6, 4, 3] 89 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 96 for n in xrange(x_shape[0]): 115 x_shape = [2, 6, 4, 3] 122 1.0, shape=x_shape, name="x", dtype=dtypes.float32) 134 for n in xrange(x_shape[0]): 160 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) 116 x_shape = [3, height, width, 2] 117 x = np.random.random_sample(x_shape).astype(np.float32) 145 x_shape = [2, 5, 6, 2] 152 x_val = np.random.random_sample(x_shape).astype(np.float32) 160 [x_shape, f_shape], 175 x_shape = [2, height, width, 2] 176 x = np.arange(np.prod(x_shape), dtype=np.float32).reshape(x_shape) 216 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/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/contrib/nn/python/ops/ |
D | scaled_softplus_test.py | 49 x_shape = [5, 10] 50 x_np = np.random.randn(*x_shape).astype(np.float32) 51 alpha_np = np.float32(np.random.rand(1, x_shape[1]) + 0.01) 52 clip_np = np.float32(np.random.rand(x_shape[0], 1) * 5.) 60 [x_shape, alpha_np.shape], 61 y_tf, x_shape, 66 [x_shape, alpha_np.shape, clip_np.shape], 67 z_tf, x_shape,
|
/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/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 | 120 x_shape = [1, 2, 2, 3] 122 x_np = np.array(x_data, dtype=np.float32).reshape(x_shape) / 255. 128 y_np = np.array(y_data, dtype=np.float32).reshape(x_shape) / 255. 133 x_shape = [2, 1, 2, 3] 135 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) 138 y_np = np.array(y_data, dtype=np.uint8).reshape(x_shape) 163 for x_shape in x_shapes: 164 x_np = np.random.rand(*x_shape) * 255. 174 x_shape = [2, 2, 3] 176 x_np = np.array(x_data, dtype=np.uint8).reshape(x_shape) [all …]
|
D | fused_batchnorm_test.py | 76 x_shape = [2, 2, 6, channel] 78 x_val = np.random.random_sample(x_shape).astype(np.float32) 117 x_shape = [2, 2, 6, channel] 119 x_val = np.random.random_sample(x_shape).astype(np.float32) 186 x_shape = [2, 2, 6, channel] 188 grad_val = np.random.random_sample(x_shape).astype(np.float32) 189 x_val = np.random.random_sample(x_shape).astype(np.float32) 256 x_shape = [2, 2, 6, channel] 258 grad_val = np.random.random_sample(x_shape).astype(np.float32) 259 x_val = np.random.random_sample(x_shape).astype(np.float32)
|
/external/tensorflow/tensorflow/contrib/distributions/python/kernel_tests/bijectors/ |
D | fill_triangular_test.py | 56 x_shape = tensor_shape.TensorShape([5, 4, 6]) 61 x = array_ops.ones(shape=x_shape, dtype=dtypes.float32) 65 self.assertAllEqual(x_.shape.as_list(), x_shape.as_list()) 67 y_shape_ = b.forward_event_shape(x_shape) 70 self.assertAllEqual(x_shape_.as_list(), x_shape.as_list()) 73 b.forward_event_shape_tensor(x_shape.as_list())) 77 self.assertAllEqual(x_shape_tensor, x_shape.as_list())
|
/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])
|