/external/tensorflow/tensorflow/compiler/tf2xla/ |
D | shape_util.cc | 50 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 …]
|
D | shape_util.h | 62 const xla::Shape& input_shape, absl::Span<const int64> minor_to_major,
|
/external/tensorflow/tensorflow/compiler/xla/ |
D | layout_util.cc | 46 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 …]
|
D | layout.h | 87 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
|
D | layout.cc | 52 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 ()()
|
D | shape.cc | 105 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()
|
D | shape_util.cc | 93 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 …]
|
D | layout_util.h | 39 static Layout MakeLayout(absl::Span<const int64> minor_to_major,
|
D | literal_util.h | 251 absl::Span<const int64> minor_to_major, 320 AsInt64Slice(layout.minor_to_major()))); in CreateR2WithLayout() 407 AsInt64Slice(layout.minor_to_major()))); in CreateFromArrayWithLayout()
|
D | literal_util.cc | 346 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/ |
D | simple.hlo | 14 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/ |
D | dlpack.cc | 158 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/ |
D | layout_assignment_test.cc | 63 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/ |
D | client_library_test_base.cc | 195 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()
|
D | matrix_ops_simple_test.cc | 191 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()
|
D | broadcast_simple_test.cc | 57 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()
|
D | copy_test.cc | 138 literal_layout->minor_to_major(1), literal_layout->minor_to_major(0)}; in XLA_TEST_F()
|
/external/tensorflow/tensorflow/compiler/xla/g3doc/ |
D | shapes.md | 63 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/ |
D | shape_partition.cc | 30 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/ |
D | hlo_utils.cc | 46 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/ |
D | xla_shape.py | 69 self.message.layout.minor_to_major.extend(layout)
|
D | xla_literal.py | 49 layout_order = literal.shape.layout.minor_to_major
|
/external/tensorflow/tensorflow/compiler/xla/service/gpu/ |
D | gemm_thunk.cc | 195 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()
|
D | reduction_layout_normalizer.cc | 73 int64 logical_dim = operand_layout.minor_to_major(major_to_minor_dim_idx); in HandleReduce()
|
/external/tensorflow/tensorflow/compiler/xrt/kernels/ |
D | xrt_state_ops.h | 268 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()
|