Home
last modified time | relevance | path

Searched refs:minor_to_major (Results 1 – 25 of 44) 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.cc46 void SetDefaultLayoutToContainer(T* minor_to_major) { in SetDefaultLayoutToContainer() argument
50 const int64 size = minor_to_major->size(); in SetDefaultLayoutToContainer()
52 (*minor_to_major)[i] = size - 1 - i; in SetDefaultLayoutToContainer()
59 absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles, in MakeLayout() argument
63 for (int64 dimension_number : minor_to_major) { in MakeLayout()
103 auto* minor_to_major = layout.mutable_minor_to_major(); in CreateDefaultLayoutForRank() local
104 minor_to_major->resize(rank, 0); in CreateDefaultLayoutForRank()
105 SetDefaultLayoutToContainer(minor_to_major); in CreateDefaultLayoutForRank()
147 auto* minor_to_major = shape->mutable_layout()->mutable_minor_to_major(); in SetToDefaultLayout() local
148 minor_to_major->resize(shape->dimensions_size(), 0); in SetToDefaultLayout()
[all …]
Dlayout.h87 explicit Layout(absl::Span<const int64> minor_to_major) in Layout() argument
89 minor_to_major_(minor_to_major.begin(), minor_to_major.end()) {} in Layout()
93 Layout(absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles,
96 minor_to_major_(minor_to_major.begin(), minor_to_major.end()), in format_()
173 int64 minor_to_major(int index) const { return minor_to_major_.at(index); } in minor_to_major() function
186 absl::Span<const 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()
102 if (lhs.format() == DENSE && 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()
111 minor_to_major, tiles, element_size_in_bits, memory_space); in MakeShapeWithLayoutInternal()
218 absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles, in MakeShapeWithLayout() argument
220 return MakeShapeWithLayoutInternal(element_type, dimensions, minor_to_major, in MakeShapeWithLayout()
975 permutation, AsInt64Slice(shape.layout().minor_to_major()))) { in PermuteDimensions()
1123 AsInt64Slice(output_shape.layout().minor_to_major())), in TransposeIsBitcast()
1124 input_shape.layout().minor_to_major()); in TransposeIsBitcast()
1303 SpanToVector(simple_output_shape->layout().minor_to_major()); in AlignLayouts()
[all …]
Dlayout_util.h39 static Layout MakeLayout(absl::Span<const int64> minor_to_major,
Dliteral_util.h251 absl::Span<const int64> minor_to_major,
320 AsInt64Slice(layout.minor_to_major()))); in CreateR2WithLayout()
407 AsInt64Slice(layout.minor_to_major()))); in CreateFromArrayWithLayout()
Dliteral_util.cc346 absl::Span<const int64> minor_to_major, const LiteralSlice& literal) { in ReshapeSlice() argument
352 CHECK_EQ(new_dimensions.size(), minor_to_major.size()); in ReshapeSlice()
361 *shape_with_layout.mutable_layout() = LayoutUtil::MakeLayout(minor_to_major); in ReshapeSlice()
/external/tensorflow/tensorflow/compiler/mlir/xla/tests/translate/
Dsimple.hlo14 minor_to_major: 0
30 minor_to_major: 0
47 minor_to_major: 0
82 minor_to_major: 0
91 minor_to_major: 0
113 minor_to_major: 0
122 minor_to_major: 0
/external/tensorflow/tensorflow/compiler/xla/python/
Ddlpack.cc158 for (int i : shape.layout().minor_to_major()) { in StridesForShape()
168 std::vector<int64> minor_to_major(dims.size()); in StridesToLayout() local
169 std::iota(minor_to_major.begin(), minor_to_major.end(), 0); in StridesToLayout()
170 absl::c_sort(minor_to_major, [&](int a, int b) { in StridesToLayout()
180 for (int64 d : minor_to_major) { in StridesToLayout()
191 return minor_to_major; in StridesToLayout()
312 std::vector<int64> minor_to_major; in DLPackManagedTensorToBuffer() local
317 TF_ASSIGN_OR_RETURN(minor_to_major, StridesToLayout(dimensions, strides)); in DLPackManagedTensorToBuffer()
319 minor_to_major.resize(dlmt->dl_tensor.ndim); in DLPackManagedTensorToBuffer()
320 std::iota(minor_to_major.rbegin(), minor_to_major.rend(), 0); in DLPackManagedTensorToBuffer()
[all …]
/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/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/mlir/xla/
Dhlo_utils.cc46 if (!shape.has_layout() || shape.layout().minor_to_major().empty()) { in GetPermutationIfAvailable()
50 for (auto dim : llvm::reverse(shape.layout().minor_to_major())) { in GetPermutationIfAvailable()
/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/compiler/xla/service/gpu/
Dgemm_thunk.cc195 CHECK_LT(shape->layout().minor_to_major(row_dim), 2); in RunGemm()
196 CHECK_LT(shape->layout().minor_to_major(col_dim), 2); in RunGemm()
Dreduction_layout_normalizer.cc73 int64 logical_dim = operand_layout.minor_to_major(major_to_minor_dim_idx); in HandleReduce()
/external/tensorflow/tensorflow/compiler/xrt/kernels/
Dxrt_state_ops.h268 std::vector<int64> minor_to_major; in XRTAllocateFromTensorOp() local
270 OP_REQUIRES_OK(ctx, ctx->GetAttr("layouts", &minor_to_major)); in XRTAllocateFromTensorOp()
288 if (!minor_to_major.empty()) { in XRTAllocateFromTensorOp()
290 OP_REQUIRES_OK(ctx, GetShapeWithLayout(shape_, minor_to_major, in XRTAllocateFromTensorOp()

12