/external/tensorflow/tensorflow/python/ops/ |
D | linalg_ops_impl.py | 35 batch_shape=None, argument 43 name, default_name='eye', values=[num_rows, num_columns, batch_shape]): 45 batch_shape = [] if batch_shape is None else batch_shape 62 if isinstance(batch_shape, ops.Tensor) or isinstance(diag_size, ops.Tensor): 63 batch_shape = ops.convert_to_tensor( 64 batch_shape, name='shape', dtype=dtypes.int32) 65 diag_shape = array_ops.concat((batch_shape, [diag_size]), axis=0) 67 shape = array_ops.concat((batch_shape, [num_rows, num_columns]), axis=0) 70 batch_shape = list(batch_shape) 71 diag_shape = batch_shape + [diag_size] [all …]
|
D | linalg_ops.py | 71 batch_shape = matrix_shape[:-2] 76 identity = eye(small_dim, batch_shape=batch_shape, dtype=matrix.dtype) 200 batch_shape=None, argument 239 batch_shape=batch_shape, 326 batch_shape = tensor_shape[:-2] 331 is_io_bound = batch_shape.num_elements() > np.min(matrix_shape)
|
/external/tensorflow/tensorflow/python/kernel_tests/linalg/ |
D | linear_operator_zeros_test.py | 67 batch_shape = shape[:-2] 71 num_rows, batch_shape=batch_shape, dtype=dtype) 111 linalg_lib.LinearOperatorZeros(num_rows=2, batch_shape=2) 115 linalg_lib.LinearOperatorZeros(num_rows=2, batch_shape=[2.]) 119 linalg_lib.LinearOperatorZeros(num_rows=2, batch_shape=[-2]) 139 batch_shape = array_ops.placeholder_with_default(2, shape=None) 142 num_rows=2, batch_shape=batch_shape, assert_proper_shapes=True) 147 batch_shape = array_ops.placeholder_with_default([-2], shape=None) 150 num_rows=2, batch_shape=batch_shape, assert_proper_shapes=True) 197 num_rows=2, batch_shape=variables_module.Variable([2])) [all …]
|
D | linear_operator_identity_test.py | 57 batch_shape = shape[:-2] 61 num_rows, batch_shape=batch_shape, dtype=dtype) 62 mat = linalg_ops.eye(num_rows, batch_shape=batch_shape, dtype=dtype) 105 linalg_lib.LinearOperatorIdentity(num_rows=2, batch_shape=2) 109 linalg_lib.LinearOperatorIdentity(num_rows=2, batch_shape=[2.]) 113 linalg_lib.LinearOperatorIdentity(num_rows=2, batch_shape=[-2]) 134 batch_shape = array_ops.placeholder_with_default(2, shape=None) 137 num_rows=2, batch_shape=batch_shape, assert_proper_shapes=True) 142 batch_shape = array_ops.placeholder_with_default([-2], shape=None) 145 num_rows=2, batch_shape=batch_shape, assert_proper_shapes=True) [all …]
|
/external/tensorflow/tensorflow/python/ops/linalg/ |
D | linear_operator_low_rank_update.py | 283 batch_shape = array_ops.broadcast_static_shape( 284 self.base_operator.batch_shape, uv_shape[:-2]) 294 batch_shape, self._diag_update.shape[:-1]) 340 batch_shape = array_ops.broadcast_static_shape( 341 self.base_operator.batch_shape, 342 self.diag_operator.batch_shape) 343 batch_shape = array_ops.broadcast_static_shape( 344 batch_shape, 346 batch_shape = array_ops.broadcast_static_shape( 347 batch_shape, [all …]
|
D | linear_operator_zeros.py | 129 batch_shape=None, argument 182 batch_shape=batch_shape, 215 linear_operator_util.assert_not_ref_type(batch_shape, "batch_shape") 239 if batch_shape is None: 243 batch_shape, name="batch_shape_arg") 254 batch_shape = tensor_shape.TensorShape(self._batch_shape_static) 255 return batch_shape.concatenate(matrix_shape) 293 special_shape = self.batch_shape.concatenate([1, 1]) 337 if self.batch_shape.is_fully_defined(): 338 return array_ops.zeros(shape=self.batch_shape, dtype=self.dtype) [all …]
|
D | linear_operator_kronecker.py | 261 batch_shape = self.operators[0].batch_shape 263 batch_shape = common_shapes.broadcast_shape( 264 batch_shape, operator.batch_shape) 266 return batch_shape.concatenate(matrix_shape) 281 batch_shape = self.operators[0].batch_shape_tensor() 283 batch_shape = array_ops.broadcast_dynamic_shape( 284 batch_shape, operator.batch_shape_tensor()) 286 return array_ops.concat((batch_shape, matrix_shape), 0) 330 batch_shape = array_ops.concat( 332 x += array_ops.zeros(batch_shape, dtype=x.dtype.base_dtype) [all …]
|
D | linear_operator_identity.py | 92 d_shape = self.batch_shape.concatenate([self._min_matrix_dim()]) 209 batch_shape=None, argument 257 batch_shape=batch_shape, 290 linear_operator_util.assert_not_ref_type(batch_shape, "batch_shape") 297 if batch_shape is None: 301 batch_shape, name="batch_shape_arg") 312 batch_shape = tensor_shape.TensorShape(self._batch_shape_static) 313 return batch_shape.concatenate(matrix_shape) 347 special_shape = self.batch_shape.concatenate([1, 1]) 383 if self.batch_shape.is_fully_defined(): [all …]
|
D | linear_operator_composition.py | 214 batch_shape = self.operators[0].batch_shape 216 batch_shape = common_shapes.broadcast_shape( 217 batch_shape, operator.batch_shape) 219 return batch_shape.concatenate(matrix_shape) 239 batch_shape = array_ops.shape(zeros) 241 return array_ops.concat((batch_shape, matrix_shape), 0)
|
D | linear_operator_block_lower_triangular.py | 368 batch_shape = self.operators[0][0].batch_shape 371 batch_shape = common_shapes.broadcast_shape( 372 batch_shape, operator.batch_shape) 374 return batch_shape.concatenate(matrix_shape) 386 batch_shape = self.operators[0][0].batch_shape_tensor() 389 batch_shape = array_ops.broadcast_dynamic_shape( 390 batch_shape, operator.batch_shape_tensor()) 392 return array_ops.concat((batch_shape, matrix_shape), 0)
|
D | linear_operator_block_diag.py | 265 batch_shape = self.operators[0].batch_shape 267 batch_shape = common_shapes.broadcast_shape( 268 batch_shape, operator.batch_shape) 270 return batch_shape.concatenate(matrix_shape) 286 batch_shape = array_ops.shape(zeros) 288 return array_ops.concat((batch_shape, matrix_shape), 0)
|
D | linear_operator_addition.py | 221 batch_shape = operators[0].batch_shape 223 batch_shape = array_ops.broadcast_static_shape(batch_shape, op.batch_shape)
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | matrix_solve_ls_op_test.py | 47 batch_shape = matrix_shape[:-2] 56 np.tile(matrix, batch_shape + (1, 1)), trainable=False) 57 rhs = variables.Variable(np.tile(rhs, batch_shape + (1, 1)), trainable=False) 89 batch_shape=()): argument 110 if batch_shape != (): 111 a = np.tile(a, batch_shape + (1, 1)) 112 b = np.tile(b, batch_shape + (1, 1)) 113 np_ans = np.tile(np_ans, batch_shape + (1, 1)) 114 np_r_norm = np.tile(np_r_norm, batch_shape) 192 for batch_shape in (), (2, 3): [all …]
|
D | matrix_band_part_op_test.py | 148 for batch_shape in ((), (2,), (1, 3, 2)): 153 "_".join(map(str, batch_shape + shape))) 155 _GetMatrixBandPartTest(dtype, batch_shape, shape)) 158 for batch_shape in ((), (2,)): 163 "_".join(map(str, batch_shape + shape))) 165 _GetMatrixBandPartGradTest(dtype, batch_shape, shape))
|
D | linalg_ops_test.py | 161 batch_shape = (2, 3) 164 linalg_ops.eye(num_rows=2, batch_shape=batch_shape).shape) 168 num_rows=2, num_columns=3, batch_shape=batch_shape).shape) 186 batch_shape = (2, 3) 190 batch_shape=batch_shape) 217 def test_eye_no_placeholder(self, num_rows, num_columns, batch_shape, dtype): argument 219 if batch_shape is not None: 220 eye_np = np.tile(eye_np, batch_shape + [1, 1]) 224 batch_shape=batch_shape, 248 self, num_rows, num_columns, batch_shape, dtype): argument [all …]
|
D | lu_op_test.py | 73 batch_shape = lu_shape[:-2] 81 num_rows, batch_shape=batch_shape, dtype=lower.dtype) 88 np.append(batch_shape, num_rows), dtype=lower.dtype) 256 batch_shape = shape[:-2] 262 return np.tile(matrix, batch_shape + (1, 1))
|
/external/tensorflow/tensorflow/compiler/tests/ |
D | matrix_band_part_test.py | 169 def testMatrixBandPart(self, batch_shape, rows, cols): argument 171 if self.device == 'XLA_CPU' and cols == 7 and rows == 1 and batch_shape == [ 177 mat = np.ones(batch_shape + [rows, cols]).astype(dtype) 178 batch_mat = np.tile(mat, batch_shape + [1, 1]) 186 if batch_shape: 187 band_np = np.tile(band_np, batch_shape + [1, 1])
|
/external/tensorflow/tensorflow/core/ops/ |
D | linalg_ops.cc | 37 ShapeHandle batch_shape; in MakeBatchSquareMatrix() local 38 TF_RETURN_IF_ERROR(c->Subshape(s, 0, -2, &batch_shape)); in MakeBatchSquareMatrix() 39 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(d, d), out)); in MakeBatchSquareMatrix() 166 ShapeHandle batch_shape; in SelfAdjointEigV2ShapeFn() local 167 TF_RETURN_IF_ERROR(c->Subshape(input, 0, -2, &batch_shape)); in SelfAdjointEigV2ShapeFn() 169 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Vector(n), &e_shape)); in SelfAdjointEigV2ShapeFn() 175 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(n, n), &v_shape)); in SelfAdjointEigV2ShapeFn() 193 ShapeHandle batch_shape; in LuShapeFn() local 194 TF_RETURN_IF_ERROR(c->Subshape(input, 0, -2, &batch_shape)); in LuShapeFn() 199 TF_RETURN_IF_ERROR(c->Concatenate(batch_shape, c->Matrix(n, n), &lu_shape)); in LuShapeFn() [all …]
|
/external/tensorflow/tensorflow/python/kernel_tests/distributions/ |
D | normal_test.py | 124 self.assertAllEqual(normal.batch_shape, log_pdf.get_shape()) 125 self.assertAllEqual(normal.batch_shape, self.evaluate(log_pdf).shape) 133 self.assertAllEqual(normal.batch_shape, pdf.get_shape()) 134 self.assertAllEqual(normal.batch_shape, self.evaluate(pdf).shape) 160 self.assertAllEqual(normal.batch_shape, log_pdf.get_shape()) 161 self.assertAllEqual(normal.batch_shape, self.evaluate(log_pdf).shape) 170 self.assertAllEqual(normal.batch_shape, pdf.get_shape()) 171 self.assertAllEqual(normal.batch_shape, pdf_values.shape) 194 self.assertAllEqual(normal.batch_shape, cdf.get_shape()) 195 self.assertAllEqual(normal.batch_shape, self.evaluate(cdf).shape) [all …]
|
D | categorical_test.py | 40 def make_categorical(batch_shape, num_classes, dtype=dtypes.int32): argument 42 list(batch_shape) + [num_classes], -10, 10, dtype=dtypes.float32) - 50. 70 for batch_shape in ([], [1], [2, 3, 4]): 71 dist = make_categorical(batch_shape, 10) 72 self.assertAllEqual(batch_shape, dist.batch_shape) 73 self.assertAllEqual(batch_shape, dist.batch_shape_tensor()) 81 for batch_shape in ([], [1], [2, 3, 4]): 83 batch_shape, constant_op.constant( 85 self.assertAllEqual(len(batch_shape), dist.batch_shape.ndims) 86 self.assertAllEqual(batch_shape, dist.batch_shape_tensor())
|
/external/tensorflow/tensorflow/core/kernels/linalg/ |
D | linalg_ops_common.cc | 93 TensorShape batch_shape; in Compute() local 94 AnalyzeInputs(context, &inputs, &input_matrix_shapes, &batch_shape); in Compute() 99 PrepareOutputs(context, input_matrix_shapes, batch_shape, &outputs, in Compute() 113 batch_shape.num_elements(), GetCostPerUnit(input_matrix_shapes), shard); in Compute() 119 TensorShapes* input_matrix_shapes, TensorShape* batch_shape) { in AnalyzeInputs() argument 133 batch_shape->AddDim(in.dim_size(dim)); in AnalyzeInputs() 142 context, in.dim_size(dim) == batch_shape->dim_size(dim), in AnalyzeInputs() 163 const TensorShape& batch_shape, TensorOutputs* outputs, in PrepareOutputs() argument 195 output_tensor_shape = batch_shape; in PrepareOutputs()
|
D | lu_op.cc | 80 TensorShape batch_shape; in Compute() local 82 batch_shape.AddDim(input.dim_size(dim)); in Compute() 93 TensorShape permutation_shape = batch_shape; in Compute() 124 batch_shape.num_elements(), GetCostPerUnit(input_matrix_shape), in Compute()
|
/external/tensorflow/tensorflow/python/kernel_tests/proto/ |
D | decode_proto_op_test_base.py | 74 def _compareProtos(self, batch_shape, sizes, fields, field_dict): argument 96 self.assertEqual(list(values.shape)[:-1], batch_shape) 149 def _runDecodeProtoTests(self, fields, case_sizes, batch_shape, batch, argument 179 batch = np.reshape(batch, batch_shape) 200 np.all(np.array(sizes.shape) == batch_shape + [len(field_names)])) 210 self._compareProtos(batch_shape, sizes, fields, field_dict)
|
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
D | matrix_band_part_op.cc | 57 TensorShape batch_shape = input_shape; in Compile() local 58 batch_shape.RemoveLastDims(2); in Compile() 82 indicator = xla::Broadcast(indicator, batch_shape.dim_sizes()); in Compile()
|
/external/tensorflow/tensorflow/python/ops/distributions/ |
D | distribution.py | 650 if self.batch_shape.is_fully_defined(): 651 return ops.convert_to_tensor(self.batch_shape.as_list(), 660 def batch_shape(self): member in Distribution 732 self._is_scalar_helper(self.batch_shape, self.batch_shape_tensor), 1211 maybe_batch_shape=(", batch_shape={}".format(self.batch_shape) 1212 if self.batch_shape.ndims is not None 1227 batch_shape=self.batch_shape, 1276 batch_ndims = self.batch_shape.ndims 1307 self.batch_shape).concatenate([None]*event_ndims)
|