Home
last modified time | relevance | path

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

12

/external/tensorflow/tensorflow/compiler/tf2xla/
Dshape_util.cc50 xla::StatusOr<bool> MakeLayout(absl::Span<const int64> minor_to_major, in MakeLayout() argument
52 if (std::all_of(minor_to_major.begin(), minor_to_major.end(), in MakeLayout()
56 std::vector<bool> dim_present(minor_to_major.size(), false); in MakeLayout()
57 for (auto dim : minor_to_major) { in MakeLayout()
58 if (dim < 0 || dim >= minor_to_major.size()) { in MakeLayout()
60 " rank=", minor_to_major.size()); in MakeLayout()
67 *layout = xla::LayoutUtil::MakeLayout(minor_to_major); in MakeLayout()
72 absl::Span<const int64> minor_to_major, in AssignLayout() argument
76 TF_ASSIGN_OR_RETURN(bool has_layout, MakeLayout(minor_to_major, &layout)); in AssignLayout()
131 const xla::Shape& input_shape, absl::Span<const int64> minor_to_major, in GetShapeWithLayout() argument
[all …]
Dshape_util.h62 const xla::Shape& input_shape, absl::Span<const int64> minor_to_major,
/external/tensorflow/tensorflow/compiler/xla/
Dlayout_util.cc44 void SetDefaultLayoutToContainer(std::vector<int64>* minor_to_major) { in SetDefaultLayoutToContainer() argument
48 const int64 size = minor_to_major->size(); in SetDefaultLayoutToContainer()
50 (*minor_to_major)[i] = size - 1 - i; in SetDefaultLayoutToContainer()
57 absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles, in MakeLayout() argument
61 for (int64 dimension_number : minor_to_major) { in MakeLayout()
107 std::vector<int64>* minor_to_major = layout.mutable_minor_to_major(); in CreateDefaultLayoutForRank() local
108 minor_to_major->resize(rank, 0); in CreateDefaultLayoutForRank()
109 SetDefaultLayoutToContainer(minor_to_major); in CreateDefaultLayoutForRank()
151 auto* minor_to_major = shape->mutable_layout()->mutable_minor_to_major(); in SetToDefaultLayout() local
152 minor_to_major->resize(shape->dimensions_size(), 0); in SetToDefaultLayout()
[all …]
Dlayout.h82 explicit Layout(absl::Span<const int64> minor_to_major) in Layout() argument
84 minor_to_major_(minor_to_major.begin(), minor_to_major.end()) {} in Layout()
88 Layout(absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles,
91 minor_to_major_(minor_to_major.begin(), minor_to_major.end()), in format_()
154 int64 minor_to_major(int index) const { return minor_to_major_.at(index); } in minor_to_major() function
167 const std::vector<int64>& minor_to_major() const { return minor_to_major_; } in minor_to_major() function
Dlayout.cc52 for (const int64 dimension : proto.minor_to_major()) { in CreateFromProto()
67 for (const int64 dimension : minor_to_major()) { in ToProto()
90 return absl::StrCat("{", absl::StrJoin(minor_to_major(), ","), in ToString()
100 lhs.minor_to_major() != rhs.minor_to_major() || in operator ()()
Dshape.cc105 for (int64 i = 0; i < layout_.minor_to_major().size();) { in DeleteDimension()
106 if (layout_.minor_to_major(i) == dim_to_delete) { in DeleteDimension()
111 if (layout_.minor_to_major(i) > dim_to_delete) { in DeleteDimension()
Dshape_util.cc93 absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles, in MakeShapeWithLayoutInternal() argument
95 if (dimensions.size() != minor_to_major.size()) { in MakeShapeWithLayoutInternal()
97 dimensions.size(), minor_to_major.size()); in MakeShapeWithLayoutInternal()
106 LayoutUtil::MakeLayout(minor_to_major, tiles, element_size_in_bits); in MakeShapeWithLayoutInternal()
191 absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles, in MakeShapeWithLayout() argument
193 return MakeShapeWithLayoutInternal(element_type, dimensions, minor_to_major, in MakeShapeWithLayout()
975 permutation, AsInt64Slice(shape.layout().minor_to_major()))) { in PermuteDimensions()
1096 AsInt64Slice(output_shape.layout().minor_to_major())), in TransposeIsBitcast()
1097 input_shape.layout().minor_to_major()); in TransposeIsBitcast()
1275 auto layout = simple_output_shape->layout().minor_to_major(); in AlignLayouts()
[all …]
Dliteral_util.cc294 absl::Span<const int64> minor_to_major, const LiteralSlice& literal) { in ReshapeSlice() argument
300 CHECK_EQ(new_dimensions.size(), minor_to_major.size()); in ReshapeSlice()
309 *shape_with_layout.mutable_layout() = LayoutUtil::MakeLayout(minor_to_major); in ReshapeSlice()
Dlayout_util.h39 static Layout MakeLayout(absl::Span<const int64> minor_to_major,
Dliteral_util.h269 absl::Span<const int64> minor_to_major,
338 AsInt64Slice(layout.minor_to_major()))); in CreateR2WithLayout()
440 AsInt64Slice(layout.minor_to_major()))); in CreateFromArrayWithLayout()
/external/tensorflow/tensorflow/compiler/xla/service/
Dlayout_assignment_test.cc63 auto minor_to_major = in LayoutOf() local
64 FindInstruction(m, name)->shape().layout().minor_to_major(); in LayoutOf()
65 return std::vector<int64>(minor_to_major.begin(), minor_to_major.end()); in LayoutOf()
69 absl::Span<const int64> minor_to_major) { in ExpectLayoutIs() argument
70 const Layout expected = LayoutUtil::MakeLayout(minor_to_major); in ExpectLayoutIs()
79 for (const absl::Span<const int64> minor_to_major : minor_to_majors) { in ExpectTupleLayoutIs() local
80 const Layout expected = LayoutUtil::MakeLayout(minor_to_major); in ExpectTupleLayoutIs()
94 for (auto& minor_to_major : minor_to_majors) { in TEST_F() local
106 Layout layout = LayoutUtil::MakeLayout(minor_to_major); in TEST_F()
163 for (auto& minor_to_major : minor_to_majors) { in TEST_F() local
[all …]
/external/tensorflow/tensorflow/compiler/xla/tests/
Dclient_library_test_base.cc195 std::vector<int64> minor_to_major(expected.shape().rank()); in ComputeAndCompareLiteralWithAllOutputLayouts() local
196 std::iota(minor_to_major.begin(), minor_to_major.end(), 0); in ComputeAndCompareLiteralWithAllOutputLayouts()
200 AsInt64Slice(expected.shape().dimensions()), minor_to_major); in ComputeAndCompareLiteralWithAllOutputLayouts()
206 } while (std::next_permutation(minor_to_major.begin(), minor_to_major.end())); in ComputeAndCompareLiteralWithAllOutputLayouts()
238 std::vector<int64> minor_to_major(literal.shape().rank()); in ComputeAndCompareLiteralWithAllInputLayouts() local
239 std::iota(minor_to_major.begin(), minor_to_major.end(), 0); in ComputeAndCompareLiteralWithAllInputLayouts()
242 literal.Relayout(LayoutUtil::MakeLayout(minor_to_major)); in ComputeAndCompareLiteralWithAllInputLayouts()
252 std::next_permutation(minor_to_major.begin(), minor_to_major.end())); in ComputeAndCompareLiteralWithAllInputLayouts()
Dmatrix_ops_simple_test.cc191 auto minor_to_major = [](bool row_major) -> std::vector<int64> { in TestImpl() local
204 lhs, LayoutUtil::MakeLayout(minor_to_major(row_major))))); in TestImpl()
208 rhs, LayoutUtil::MakeLayout(minor_to_major(row_major))))); in TestImpl()
Dbroadcast_simple_test.cc57 absl::Span<const int64> minor_to_major, in MakeR3Data() argument
61 *r3_shape = ShapeUtil::MakeShapeWithLayout(F32, bounds, minor_to_major); in MakeR3Data()
64 LayoutUtil::MakeLayout(minor_to_major)); in MakeR3Data()
71 absl::Span<const int64> minor_to_major, in MakeR2Data() argument
75 *r2_shape = ShapeUtil::MakeShapeWithLayout(F32, bounds, minor_to_major); in MakeR2Data()
78 LayoutUtil::MakeLayout(minor_to_major)); in MakeR2Data()
Dcopy_test.cc138 literal_layout->minor_to_major(1), literal_layout->minor_to_major(0)}; in XLA_TEST_F()
/external/tensorflow/tensorflow/compiler/xla/g3doc/
Dshapes.md63 repeated int64 minor_to_major = 1;
71 The only required field is `minor_to_major`. This field describes the
73 `minor_to_major` are an ordering of the dimensions of the array (`0` to `N-1`
87 `minor_to_major` field in the layout is `[0, 1]` then dimension `0` is the
99 On the other hand, if the `minor_to_major` field in the layout is `[1, 0]` then
/external/tensorflow/tensorflow/compiler/xla/python/
Dxla_client.py486 def array_shape(element_type, dimensions, minor_to_major=None): argument
492 dimensions, np.dtype(element_type), minor_to_major=minor_to_major)
504 def __init__(self, dimensions, dtype, minor_to_major=None): argument
509 self._minor_to_major = minor_to_major
564 def minor_to_major(self): member in Shape
592 def update_minor_to_major(self, minor_to_major): argument
595 if not isinstance(minor_to_major, tuple):
598 minor_to_major)
606 if a.minor_to_major():
622 if self.minor_to_major():
[all …]
Dnumpy_bridge.cc278 std::vector<int64> minor_to_major(length); in XlaShapeFromPyShape() local
286 minor_to_major[i] = in XlaShapeFromPyShape()
288 if (minor_to_major[i] == -1 && PyErr_Occurred()) { in XlaShapeFromPyShape()
298 minor_to_major); in XlaShapeFromPyShape()
/external/tensorflow/tensorflow/compiler/xla/service/cpu/
Dshape_partition.cc30 const int64 dimension = shape_.layout().minor_to_major(i); in Run()
108 dimensions_[i] = shape_.layout().minor_to_major( in ShapePartitionIterator()
/external/tensorflow/tensorflow/compiler/xla/service/llvm_ir/
Dkernel_tiling.cc62 auto minor_to_major = shape.layout().minor_to_major(); in GetReshapedIndex() local
66 int64 dim = minor_to_major[i]; in GetReshapedIndex()
/external/tensorflow/tensorflow/compiler/xrt/kernels/
Dxrt_state_ops.h220 std::vector<int64> minor_to_major; in XRTAllocateFromTensorOp() local
222 OP_REQUIRES_OK(ctx, ctx->GetAttr("layouts", &minor_to_major)); in XRTAllocateFromTensorOp()
240 if (!minor_to_major.empty()) { in XRTAllocateFromTensorOp()
242 OP_REQUIRES_OK(ctx, GetShapeWithLayout(shape_, minor_to_major, in XRTAllocateFromTensorOp()
/external/tensorflow/tensorflow/compiler/xla/python_api/
Dxla_shape.py69 self.message.layout.minor_to_major.extend(layout)
Dxla_literal.py49 layout_order = literal.shape.layout.minor_to_major
/external/tensorflow/tensorflow/c/eager/
Dc_api_debug.cc130 int64 dim_index = padded_shape.layout().minor_to_major(i); in TFE_TensorHandleTensorDebugInfo()
/external/tensorflow/tensorflow/compiler/xla/service/gpu/
Dgemm_thunk.cc343 CHECK_LT(shape->layout().minor_to_major(row_dim), 2); in ExecuteOnStream()
344 CHECK_LT(shape->layout().minor_to_major(col_dim), 2); in ExecuteOnStream()

12