Home
last modified time | relevance | path

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

/external/tensorflow/tensorflow/compiler/tf2xla/
Dxla_helpers.cc181 xla::XlaBuilder* builder, xla::XlaOp original, xla::Shape original_shape, in ReshapeWithCorrectRepresentationAndSharding() argument
184 if (original_shape.IsTuple()) { in ReshapeWithCorrectRepresentationAndSharding()
186 for (int64 i = 0; i < original_shape.tuple_shapes_size(); ++i) { in ReshapeWithCorrectRepresentationAndSharding()
191 original_shape.tuple_shapes(i), in ReshapeWithCorrectRepresentationAndSharding()
197 if (!original_shape.IsArray()) return original; in ReshapeWithCorrectRepresentationAndSharding()
199 TF_RETURN_IF_ERROR(XLAShapeToTensorShape(original_shape, &shape)); in ReshapeWithCorrectRepresentationAndSharding()
201 original_shape.element_type())); in ReshapeWithCorrectRepresentationAndSharding()
210 if (xla::ShapeUtil::Compatible(original_shape, to_shape)) { in ReshapeWithCorrectRepresentationAndSharding()
211 for (int64 i = 0; i < original_shape.rank(); ++i) { in ReshapeWithCorrectRepresentationAndSharding()
212 to_shape.set_dynamic_dimension(i, original_shape.is_dynamic_dimension(i)); in ReshapeWithCorrectRepresentationAndSharding()
Dxla_helpers.h94 xla::XlaBuilder* builder, xla::XlaOp original, xla::Shape original_shape,
Dxla_compiler.cc232 TF_ASSIGN_OR_RETURN(auto original_shape, builder->GetShape(value)); in BuildComputation()
235 builder, value, original_shape, in BuildComputation()
331 TF_ASSIGN_OR_RETURN(auto original_shape, builder->GetShape(handle)); in BuildComputation()
334 builder, handle, original_shape, in BuildComputation()
/external/tensorflow/tensorflow/lite/testing/op_tests/
Dnearest_upsample.py37 def new_shape_for_upsample(original_shape, scales, axis): argument
43 for i in range(len(original_shape)):
44 input_new_shape.append(original_shape[i])
49 upsample_new_shape.append(original_shape[i] * scales[j])
52 upsample_new_shape.append(original_shape[i])
/external/tensorflow/tensorflow/compiler/xla/tests/
Dreplay_test.cc54 std::unique_ptr<ProgramShape> original_shape = in TEST_F() local
58 ASSERT_TRUE(protobuf_util::ProtobufEquals(original_shape->ToProto(), in TEST_F()
87 std::unique_ptr<ProgramShape> original_shape = in XLA_TEST_F() local
91 ASSERT_TRUE(protobuf_util::ProtobufEquals(original_shape->ToProto(), in XLA_TEST_F()
134 std::unique_ptr<ProgramShape> original_shape = in TEST_F() local
138 ASSERT_TRUE(protobuf_util::ProtobufEquals(original_shape->ToProto(), in TEST_F()
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dmirror_pad_op.cc32 const xla::Shape& original_shape, in DoMirrorPad() argument
43 for (int64 dimno = original_shape.rank() - 1; dimno >= 0; --dimno) { in DoMirrorPad()
47 int64 dim_size = original_shape.dimensions(dimno); in DoMirrorPad()
119 const xla::XlaOp t, const xla::Shape& original_shape, in DoMirrorPadGrad() argument
129 for (int64 dimno = original_shape.rank() - 1; dimno >= 0; --dimno) { in DoMirrorPadGrad()
132 int64 dim_size = original_shape.dimensions(dimno); in DoMirrorPadGrad()
/external/tensorflow/tensorflow/core/grappler/optimizers/data/vectorization/
Dreshape_vectorizer.cc34 Output GetVectorizedShape(Scope* s, Output tensor, Output original_shape) { in GetVectorizedShape() argument
44 return ops::Concat(*s, {dim_0, original_shape}, ops::Const(*s, 0)); in GetVectorizedShape()
/external/tensorflow/tensorflow/python/data/experimental/ops/
Dscan_ops.py107 for original_shape, weakened_shape in zip(flat_state_shapes,
109 if original_shape.ndims is not None and (
111 original_shape.as_list() != weakened_shape.as_list()):
Dgrouping.py359 for original_shape, weakened_shape in zip(flat_state_shapes,
361 if original_shape.ndims is not None and (
363 original_shape.as_list() != weakened_shape.as_list()):
/external/tensorflow/tensorflow/compiler/xla/client/lib/
Dprng.cc221 const Shape& original_shape) { in CombineShapePair() argument
222 if (original_shape.rank() == 0) { in CombineShapePair()
227 const int64 pre_split_size = original_shape.dimensions(shape_pair.split_dim); in CombineShapePair()
228 std::vector<int64> reshape_dims(original_shape.dimensions().begin(), in CombineShapePair()
229 original_shape.dimensions().end()); in CombineShapePair()
234 result = Slice(result, std::vector<int64>(original_shape.rank(), 0), in CombineShapePair()
235 original_shape.dimensions(), in CombineShapePair()
236 std::vector<int64>(original_shape.rank(), 1)); in CombineShapePair()
/external/tensorflow/tensorflow/compiler/xla/service/
Dbfloat16_normalization.cc173 auto original_shape = hlo->shape(); in ChangeOutputTypeThenInsertConvertBack() local
174 if (CountSubshapesWithMatchingType(original_shape, from) == 0) { in ChangeOutputTypeThenInsertConvertBack()
192 ShapeUtil::GetSubshape(original_shape, leaf_index); in ChangeOutputTypeThenInsertConvertBack()
349 auto original_shape = hlo->shape(); in HandleMultipleOutputs() local
379 *tuple->mutable_shape() = original_shape; in HandleMultipleOutputs()
Dhlo_rematerialization.cc1246 const Shape& original_shape = hlo->shape(); in GetCompactShape() local
1247 TF_ASSIGN_OR_RETURN(Shape min_shape, compact_shape_function_(original_shape)); in GetCompactShape()
1415 const Shape& original_shape = item->instruction->shape(); in PickRematerializationCandidates() local
1416 if (original_shape.IsArray()) { in PickRematerializationCandidates()
/external/tensorflow/tensorflow/python/ops/
Dembedding_ops.py880 original_shape = sparse_ids.dense_shape
884 array_ops.size(original_shape)
888 array_ops.slice(original_shape, [0], [original_rank - 1])),
889 array_ops.gather(original_shape, original_rank - 1)
932 math_ops.cast(original_shape, dtypes.int32), [0],
/external/tensorflow/tensorflow/python/keras/layers/preprocessing/
Dimage_preprocessing.py278 original_shape = inputs.shape.as_list()
279 batch_size, num_channels = original_shape[0], original_shape[3]
1195 original_shape = inputs.shape.as_list()
1196 output_shape = [original_shape[0]] + [None] + original_shape[2:4]
1292 original_shape = inputs.shape.as_list()
1293 output_shape = original_shape[0:2] + [None] + [original_shape[3]]
/external/tensorflow/tensorflow/python/ops/numpy_ops/
Dnp_array_ops.py697 original_shape = a._shape_as_list() # pylint: disable=protected-access
699 known_shape = original_shape is not None and None not in original_shape
701 if not original_shape:
702 original_shape = (repeats,)
708 original_shape = (repeats_np * np.prod(original_shape),)
710 original_shape[axis] = repeats_np * original_shape[axis]
713 original_shape = (repeats_np.sum(),)
715 original_shape[axis] = repeats_np.sum()
720 result.set_shape(original_shape)
1273 original_shape = array_ops.shape(a)
[all …]
/external/tensorflow/tensorflow/python/ops/ragged/
Dragged_tensor_shape_test.py296 original_shape = RaggedTensorDynamicShape.from_dim_sizes(original_dim_sizes)
298 self.assertEqual(original_shape.rank, bcast_shape.rank)
300 bcast1 = original_shape.broadcast_dimension(axis, row_length)
/external/tensorflow/tensorflow/python/kernel_tests/
Dsparse_reshape_op_test.py336 def _MakeAndReshapeTensor(self, tensor_class, original_shape, target_shape): argument
338 ind = np.zeros([0, len(original_shape)]).astype(np.int64)
340 shape = np.array(original_shape).astype(np.int64)
346 dense_input = array_ops.zeros(original_shape)
Darray_ops_test.py1036 original_shape = constant_op.constant([6, 4, 4], dtype=dtypes.int64)
1041 dx = array_ops.strided_slice_grad(original_shape, begin, end, strides,
1051 original_shape = constant_op.constant([6, 4, 4], dtype=dtypes.int64)
1059 dx = array_ops.strided_slice_grad(original_shape, begin, end, strides,
/external/tensorflow/tensorflow/python/keras/layers/
Dnormalization.py746 original_shape = array_ops.shape(inputs)
747 original_shape = array_ops.concat(
748 [constant_op.constant([-1]), original_shape[1:]], axis=0)
751 original_shape[1:]
759 outputs = array_ops.reshape(outputs, original_shape)
/external/tensorflow/tensorflow/core/grappler/costs/
Dop_level_cost_estimator.h32 TensorShapeProto MaybeGetMinimumShape(const TensorShapeProto& original_shape,
Dop_level_cost_estimator.cc322 TensorShapeProto MaybeGetMinimumShape(const TensorShapeProto& original_shape, in MaybeGetMinimumShape() argument
324 auto shape = original_shape; in MaybeGetMinimumShape()
342 shape.add_dim()->set_size(original_shape.dim(i).size()); in MaybeGetMinimumShape()
/external/tensorflow/tensorflow/core/kernels/
Dstrided_slice_op.cc350 TensorShape original_shape = old_lhs->shape(); in Compute() local
/external/tensorflow/tensorflow/python/keras/
Dbackend.py3198 original_shape = int_shape(x)
3217 if original_shape[rows] is None:
3220 new_height = original_shape[rows] * height_factor
3222 if original_shape[cols] is None:
3225 new_width = original_shape[cols] * width_factor
/external/tensorflow/tensorflow/python/data/ops/
Ddataset_ops.py2188 for original_shape, weakened_shape in zip(flat_state_shapes,
2190 if original_shape.ndims is not None and (
2192 original_shape.as_list() != weakened_shape.as_list()):
/external/tensorflow/tensorflow/compiler/xla/client/
Dxla_builder.cc1196 TF_ASSIGN_OR_RETURN(const Shape* original_shape, GetShapePtr(operand)); in Collapse()
1198 VLOG(3) << "original shape: " << ShapeUtil::HumanString(*original_shape); in Collapse()
1202 for (int i = 0; i < original_shape->rank(); ++i) { in Collapse()
1204 new_sizes.push_back(original_shape->dimensions(i)); in Collapse()
1206 new_sizes.back() *= original_shape->dimensions(i); in Collapse()