/external/tensorflow/tensorflow/contrib/distributions/python/ops/ |
D | batch_reshape.py | 160 new_shape = array_ops.concat( 167 return array_ops.reshape(x, new_shape) 248 new_shape = array_ops.concat( 253 result = array_ops.reshape(result, new_shape) 256 new_shape = static_sample_shape.concatenate(self.batch_shape) 257 result.set_shape(result.shape.merge_with(new_shape)) 271 new_shape = array_ops.concat( 273 result = array_ops.reshape(fn(), new_shape) 373 def calculate_reshape(original_shape, new_shape, validate=False, name=None): argument 375 batch_shape_static = tensor_util.constant_value_as_shape(new_shape) [all …]
|
D | shape.py | 406 new_shape = array_ops.concat([[-1], batch_shape, event_shape], 0) 407 x = array_ops.reshape(x, shape=new_shape) 464 new_shape = array_ops.concat([sample_shape, batch_shape, event_shape], 0) 465 x = array_ops.reshape(x, shape=new_shape)
|
/external/tensorflow/tensorflow/compiler/xla/service/cpu/ |
D | cpu_layout_assignment.cc | 81 Shape new_shape(old_shape); in RowMajorShape() local 82 std::vector<int64> dimension_order(new_shape.dimensions_size()); in RowMajorShape() 84 *new_shape.mutable_layout() = LayoutUtil::MakeLayout(dimension_order); in RowMajorShape() 85 return new_shape; in RowMajorShape() 89 Shape new_shape(old_shape); in ColMajorShape() local 90 std::vector<int64> dimension_order(new_shape.dimensions_size()); in ColMajorShape() 92 *new_shape.mutable_layout() = LayoutUtil::MakeLayout(dimension_order); in ColMajorShape() 93 return new_shape; in ColMajorShape()
|
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/ |
D | shape_op.cc | 139 std::vector<int64> new_shape(existing_dims_size); in Compile() local 140 for (size_t i = 0; i < new_shape.size(); ++i) { in Compile() 141 new_shape[i] = existing_dims[i]; in Compile() 152 new_shape.emplace(new_shape.begin() + dim, 1); in Compile() 154 ctx->SetOutput(0, xla::Reshape(ctx->Input("input"), new_shape)); in Compile() 172 std::vector<int64> new_shape; in Compile() local 202 new_shape.push_back(existing_dim); in Compile() 207 new_shape.push_back(existing_dim); in Compile() 212 ctx->SetOutput(0, xla::Reshape(ctx->Input(0), new_shape)); in Compile()
|
D | dynamic_stitch_op.cc | 154 TensorShape new_shape; in Compile() local 156 new_shape.AddDim(indices[input_num].shape().dimensions(0)); in Compile() 159 new_shape.AddDim(data0_shape.dim_size(d)); in Compile() 163 if (new_shape == data_shapes[input_num]) { in Compile() 166 input[input_num] = xla::Reshape(handle, new_shape.dim_sizes()); in Compile()
|
/external/tensorflow/tensorflow/core/api_def/base_api/ |
D | api_def_SparseReshape.pbtxt | 17 name: "new_shape" 33 SparseTensor. This is the same as `new_shape` but with any -1 dimensions 40 tensor. The `input_indices` are recomputed based on the requested `new_shape`. 42 If one component of `new_shape` is the special value -1, the size of that 44 most one component of `new_shape` can be -1. The number of dense elements 45 implied by `new_shape` must be the same as the number of dense elements 50 If the input tensor has rank `R_in` and `N` non-empty values, and `new_shape`
|
/external/tensorflow/tensorflow/lite/ |
D | string_util_test.cc | 57 auto new_shape = TfLiteIntArrayCreate(2); in TEST() local 58 new_shape->data[0] = 2; in TEST() 59 new_shape->data[1] = 1; in TEST() 60 buf0.WriteToTensor(t0, new_shape); in TEST() 147 auto new_shape = TfLiteIntArrayCreate(2); in TEST() local 148 new_shape->data[0] = 1; in TEST() 149 new_shape->data[1] = 2; in TEST() 151 buf.WriteToTensor(t0, new_shape); in TEST()
|
D | string_util.cc | 106 TfLiteIntArray* new_shape) { in WriteToTensor() argument 110 if (new_shape == nullptr) { in WriteToTensor() 111 new_shape = TfLiteIntArrayCopy(tensor->dims); in WriteToTensor() 115 TfLiteTensorReset(tensor->type, tensor->name, new_shape, tensor->params, in WriteToTensor()
|
/external/tensorflow/tensorflow/core/kernels/ |
D | shape_ops.h | 157 std::vector<int64> new_shape(existing_dims_size); in Compute() 158 for (size_t i = 0; i < new_shape.size(); ++i) { in Compute() 159 new_shape[i] = existing_dims[i]; in Compute() 170 new_shape.emplace(new_shape.begin() + dim, 1); in Compute() 171 const TensorShape output_shape(new_shape); in Compute() 202 std::vector<int64> new_shape; in Compute() local 233 new_shape.push_back(existing_dim); in Compute() 238 new_shape.push_back(existing_dim); in Compute() 243 const TensorShape output_shape(new_shape); in Compute()
|
/external/tensorflow/tensorflow/compiler/xla/service/gpu/ |
D | cudnn_conv_pad_for_tensor_cores.cc | 46 const Shape& new_shape) { in PadInstruction() argument 57 if (shape.dimensions(dim) == new_shape.dimensions(dim)) { in PadInstruction() 60 CHECK_GT(new_shape.dimensions(dim), shape.dimensions(dim)); in PadInstruction() 62 new_shape.dimensions(dim) - shape.dimensions(dim)); in PadInstruction() 70 HloInstruction::CreatePad(new_shape, instr, zero, pad_config)); in PadInstruction() 185 const Shape& new_shape) { in PadForTensorCores() argument 187 int64 new_bytes = ShapeUtil::ByteSizeOf(new_shape); in PadForTensorCores() 195 << ShapeUtil::HumanString(new_shape) << ", a size increase of " in PadForTensorCores()
|
D | variadic_op_splitter.cc | 58 Shape new_shape = concat->shape(); in SplitConcatenate() local 66 new_shape.set_dimensions(concat->concatenate_dimension(), in SplitConcatenate() 69 new_shape, operands_span.subspan(offset, kMaxParameters))); in SplitConcatenate()
|
D | cudnn_conv_rewriter.cc | 472 Shape new_shape = rhs->shape(); in MatchBackwardInput() local 480 int64 input_features = new_shape.dimensions(input_feature_dimension); in MatchBackwardInput() 481 int64 output_features = new_shape.dimensions(output_feature_dimension); in MatchBackwardInput() 482 new_shape.set_dimensions(input_feature_dimension, in MatchBackwardInput() 484 new_shape.set_dimensions(output_feature_dimension, in MatchBackwardInput() 487 rhs = c->AddInstruction(HloInstruction::CreateReshape(new_shape, rhs)); in MatchBackwardInput()
|
/external/tensorflow/tensorflow/python/ops/ |
D | special_math_ops.py | 384 new_shape = ( 387 t0 = _reshape_if_necessary(t0, new_shape) 392 new_shape = ( 395 t1 = _reshape_if_necessary(t1, new_shape) 420 def _reshape_if_necessary(tensor, new_shape): argument 423 new_shape = tuple(-1 if x is None else x for x in new_shape) 425 if (len(new_shape) == len(cur_shape) and 426 all(d0 == d1 or d1 == -1 for d0, d1 in zip(cur_shape, new_shape))): 429 return array_ops.reshape(tensor, new_shape)
|
D | random_grad.py | 29 new_shape = array_ops.concat( 32 return array_ops.reshape(x, new_shape)
|
/external/tensorflow/tensorflow/python/ops/parallel_for/ |
D | gradients.py | 72 new_shape = array_ops.concat( 74 out = array_ops.reshape(out, new_shape) 141 new_shape = array_ops.concat([output_shape, inp_shape[1:]], axis=0) 142 return array_ops.reshape(output, new_shape)
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | sparse_ops_test.py | 359 new_shape = np.array([3, 6, 7], dtype=np.int64) 360 sp_output = sparse_ops.sparse_reset_shape(sp_input, new_shape) 366 new_shape = np.array([3, 6, 7], dtype=np.int64) 367 sp_output = sparse_ops.sparse_reset_shape(sp_input, new_shape) 379 new_shape = np.array([3, 6, 7], dtype=np.int64) 380 sp_output = sparse_ops.sparse_reset_shape(sp_input, new_shape) 393 new_shape = np.array([3, 6, 7], dtype=np.int64) 394 sp_output = sparse_ops.sparse_reset_shape(sp_input, new_shape) 430 new_shape = np.array([3, 7], dtype=np.int64) 433 sparse_ops.sparse_reset_shape(sp_input, new_shape) [all …]
|
D | sparse_reshape_op_test.py | 281 new_shape = array_ops.placeholder(dtypes.int64) 282 sp_output = sparse_ops.sparse_reshape(sp_input, new_shape) 298 new_shape = [np.prod(factors[new_map == d]) for d in range(new_rank)] 304 new_dense = np.reshape(orig_dense, new_shape) 311 sp_output = sparse_ops.sparse_reshape(sp_input, new_shape) 316 self.assertAllEqual(output_val.dense_shape, new_shape)
|
/external/tensorflow/tensorflow/compiler/xla/service/ |
D | reshape_mover.cc | 142 const Shape new_shape = in UpdateOperand() local 150 HloInstruction::CreateReshape(new_shape, operand)); in UpdateOperand() 157 new_shape, operand, inverse_permutation)); in UpdateOperand() 164 operand->CloneWithNewOperands(new_shape, operand->operands())); in UpdateOperand() 174 operand->CloneWithNewOperands(new_shape, operand->operands())); in UpdateOperand()
|
/external/tensorflow/tensorflow/contrib/distributions/python/ops/bijectors/ |
D | chain.py | 225 new_shape = input_shape 231 new_shape = func(new_shape) 232 return new_shape
|
D | reshape.py | 282 new_shape = event_shape_out 284 new_shape = array_ops.concat( 287 return array_ops.reshape(x, new_shape)
|
/external/tensorflow/tensorflow/core/grappler/optimizers/ |
D | remapper.cc | 645 NodeDef* new_shape = optimized_graph->add_node(); in AddBatchNormNodes() local 646 new_shape->set_name(AddPrefixToNodeName("NCHWShape", fused_node.name())); in AddBatchNormNodes() 647 new_shape->set_op("Const"); in AddBatchNormNodes() 648 new_shape->set_device(fused_node.device()); in AddBatchNormNodes() 649 *new_shape->add_input() = AsControlDependency(scale); in AddBatchNormNodes() 650 (*new_shape->mutable_attr())["dtype"].set_type(DT_INT32); in AddBatchNormNodes() 657 (*new_shape->mutable_attr())["value"].mutable_tensor()); in AddBatchNormNodes() 665 *reshaped_scale->add_input() = new_shape->name(); in AddBatchNormNodes() 676 *reshaped_offset->add_input() = new_shape->name(); in AddBatchNormNodes() 687 *reshaped_mean->add_input() = new_shape->name(); in AddBatchNormNodes() [all …]
|
/external/tensorflow/tensorflow/core/framework/ |
D | shape_inference.h | 247 ShapeHandle new_shape; in MergeInput() local 248 if (!Merge(inputs_[idx], shape, &new_shape).ok()) return false; in MergeInput() 249 inputs_[idx] = new_shape; in MergeInput() 279 ShapeHandle new_shape; in RelaxInput() local 280 Relax(inputs_[idx], shape, &new_shape); in RelaxInput() 281 if (inputs_[idx].SameHandle(new_shape)) { in RelaxInput() 284 inputs_[idx] = new_shape; in RelaxInput()
|
/external/tensorflow/tensorflow/contrib/data/python/ops/ |
D | batching.py | 204 original_shape.merge_with(new_shape) 205 for original_shape, new_shape in zip(flat_original_shapes,
|
/external/tensorflow/tensorflow/compiler/xla/ |
D | shape_util.cc | 764 Shape new_shape = original; in ChangeElementType() local 765 new_shape.set_element_type(type); in ChangeElementType() 766 return new_shape; in ChangeElementType() 932 Shape new_shape = shape; in PermuteDimensions() local 933 new_shape.clear_dimensions(); in PermuteDimensions() 935 new_shape.add_dimensions(dim); in PermuteDimensions() 938 new_shape.set_dynamic_dimension(permutation[i], in PermuteDimensions() 971 Layout* new_layout = new_shape.mutable_layout(); in PermuteDimensions() 980 CHECK(TransposeIsBitcast(shape, new_shape, InversePermutation(permutation))) in PermuteDimensions() 982 << ", new_shape=" << HumanStringWithLayout(new_shape) in PermuteDimensions() [all …]
|
/external/tensorflow/tensorflow/core/ops/ |
D | array_ops_test.cc | 871 Tensor new_shape = test::AsTensor<int32>({1, 2, 3}); in TEST() local 872 op.input_tensors[1] = &new_shape; in TEST() 882 new_shape = test::AsTensor<int32>({-1}); in TEST() 886 new_shape = test::AsTensor<int32>({2, -1}); in TEST() 893 new_shape = test::AsTensor<int32>({-1, -1, 2}); in TEST() 897 new_shape = test::AsTensor<int32>({-1, 2, 3}); in TEST() 901 new_shape = test::AsTensor<int32>({}); in TEST() 908 new_shape = test::AsTensor<int32>({-1}); in TEST() 910 new_shape = test::AsTensor<int32>({-1, 6}); in TEST() 912 new_shape = test::AsTensor<int32>({0, -1}); in TEST() [all …]
|