Home
last modified time | relevance | path

Searched refs:new_shape (Results 1 – 25 of 86) sorted by relevance

1234

/external/tensorflow/tensorflow/contrib/distributions/python/ops/
Dbatch_reshape.py160 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 …]
Dshape.py406 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/
Dcpu_layout_assignment.cc81 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/
Dshape_op.cc139 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()
Ddynamic_stitch_op.cc154 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/
Dapi_def_SparseReshape.pbtxt17 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/
Dstring_util_test.cc57 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()
Dstring_util.cc106 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/
Dshape_ops.h157 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/
Dcudnn_conv_pad_for_tensor_cores.cc46 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()
Dvariadic_op_splitter.cc58 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()
Dcudnn_conv_rewriter.cc472 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/
Dspecial_math_ops.py384 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)
Drandom_grad.py29 new_shape = array_ops.concat(
32 return array_ops.reshape(x, new_shape)
/external/tensorflow/tensorflow/python/ops/parallel_for/
Dgradients.py72 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/
Dsparse_ops_test.py359 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 …]
Dsparse_reshape_op_test.py281 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/
Dreshape_mover.cc142 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/
Dchain.py225 new_shape = input_shape
231 new_shape = func(new_shape)
232 return new_shape
Dreshape.py282 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/
Dremapper.cc645 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/
Dshape_inference.h247 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/
Dbatching.py204 original_shape.merge_with(new_shape)
205 for original_shape, new_shape in zip(flat_original_shapes,
/external/tensorflow/tensorflow/compiler/xla/
Dshape_util.cc764 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/
Darray_ops_test.cc871 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 …]

1234