Home
last modified time | relevance | path

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

12

/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/
Dlegalize_hlo_patterns.td63 def : Pat<(fromToBinPair[1] $l, $r, $broadcast_dimensions),
65 [(IsLegalNumpyRankedBroadcast $l, $r, $broadcast_dimensions)]>;
72 def : Pat<(pair[1] TF_IntTensor:$l, TF_IntTensor:$r, $broadcast_dimensions),
74 [(IsLegalNumpyRankedBroadcast $l, $r, $broadcast_dimensions)]>;
80 def : Pat<(pair[1] I1Tensor:$l, I1Tensor:$r, $broadcast_dimensions),
82 [(IsLegalNumpyRankedBroadcast $l, $r, $broadcast_dimensions)]>;
87 $broadcast_dimensions),
89 [(IsLegalNumpyRankedBroadcast $l, $r, $broadcast_dimensions)]>;
92 $broadcast_dimensions),
94 [(IsLegalNumpyRankedBroadcast $l, $r, $broadcast_dimensions)]>;
[all …]
Dlegalize_hlo.cc1190 bool IsTFStyleBroadcast(DenseIntElementsAttr broadcast_dimensions, in IsTFStyleBroadcast() argument
1194 int64_t input_rank = broadcast_dimensions.getNumElements(); in IsTFStyleBroadcast()
1197 (broadcast_dimensions.getValue({0}).cast<IntegerAttr>().getInt() == in IsTFStyleBroadcast()
1204 DenseIntElementsAttr broadcast_dimensions, in ExpandedShape() argument
1213 for (auto x : llvm::enumerate(broadcast_dimensions)) { in ExpandedShape()
/external/tensorflow/tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/
Dchlo_ops.cc96 llvm::SmallVector<int64_t, 4> broadcast_dimensions; in GetBroadcastType() local
100 broadcast_dimensions.push_back(int_value.getSExtValue()); in GetBroadcastType()
102 if (broadcast_dimensions.size() != shape_small.size()) { in GetBroadcastType()
108 broadcast_dimensions = llvm::to_vector<4>(llvm::seq<int64_t>( in GetBroadcastType()
116 for (auto index_pair : llvm::enumerate(broadcast_dimensions)) { in GetBroadcastType()
132 DenseIntElementsAttr broadcast_dimensions = in InferBroadcastBinaryOpReturnTypeComponents() local
144 GetBroadcastType(lhs_type, rhs_type, element_type, broadcast_dimensions); in InferBroadcastBinaryOpReturnTypeComponents()
166 auto broadcast_dimensions = op->getAttr("broadcast_dimensions") in ReifyBroadcastBinaryOpReturnTypeShapes() local
168 if (broadcast_dimensions && in ReifyBroadcastBinaryOpReturnTypeShapes()
169 !hlo::IsLegalNumpyRankedBroadcast(lhs, rhs, broadcast_dimensions)) { in ReifyBroadcastBinaryOpReturnTypeShapes()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/hlo/tests/
Dchlo_legalize_to_hlo_broadcasts.mlir23 … "mhlo.dynamic_broadcast_in_dim"(%[[ARG0]], %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<1> …
24 … "mhlo.dynamic_broadcast_in_dim"(%[[ARG1]], %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<[0,…
44 … "mhlo.dynamic_broadcast_in_dim"(%[[ARG0]], %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<1> …
45 … "mhlo.dynamic_broadcast_in_dim"(%[[ARG1]], %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<[0,…
65 … "mhlo.dynamic_broadcast_in_dim"(%[[ARG0]], %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<1> …
66 … "mhlo.dynamic_broadcast_in_dim"(%[[ARG1]], %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<[0,…
76 // Verifies that broadcast_dimensions validity checks are valid.
80 …%0 = chlo.broadcast_add %arg0, %arg1 {broadcast_dimensions = dense<1> : tensor<1xi64>} : (tensor<1…
85 // Verifies that broadcast_dimensions validity checks are valid.
89 …%0 = chlo.broadcast_add %arg0, %arg1 {broadcast_dimensions = dense<[]> : tensor<0xi64>} : (tensor<…
[all …]
Dunfuse_batch_norm.mlir16 …// CHECK-DAG: %[[STDDEV_BCAST:.+]] = "mhlo.broadcast_in_dim"(%[[STDDEV]]) {broadcast_dimensions = …
17 …// CHECK-DAG: %[[SCALE_BCAST:.+]] = "mhlo.broadcast_in_dim"(%[[SCALE]]) {broadcast_dimensions = de…
18 …// CHECK-DAG: %[[OFFSET_BCAST:.+]] = "mhlo.broadcast_in_dim"(%[[OFFSET]]) {broadcast_dimensions = …
19 …// CHECK-DAG: %[[MEAN_BCAST:.+]] = "mhlo.broadcast_in_dim"(%[[MEAN]]) {broadcast_dimensions = dens…
38 // CHECK-DAG: %[[SCALE_BCAST:.+]] = "mhlo.broadcast_in_dim"(%[[SCALE]]) {broadcast_dimensions = den…
113 …= "mhlo.dynamic_broadcast_in_dim"(%[[EPS]], %[[TO_DIM_TENSOR]]) {broadcast_dimensions = dense<> :…
121 …dynamic_broadcast_in_dim"(%[[STDDEV]], %[[TO_INPUT_DIM_TENSOR]]) {broadcast_dimensions = dense<1> …
122 ….dynamic_broadcast_in_dim"(%[[SCALE]], %[[TO_INPUT_DIM_TENSOR]]) {broadcast_dimensions = dense<1> …
123 …dynamic_broadcast_in_dim"(%[[OFFSET]], %[[TO_INPUT_DIM_TENSOR]]) {broadcast_dimensions = dense<1> …
124 …o.dynamic_broadcast_in_dim"(%[[MEAN]], %[[TO_INPUT_DIM_TENSOR]]) {broadcast_dimensions = dense<1> …
Dops.mlir97 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[1, 2]> : tensor<2xi64>} : (tens…
105 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[]> : tensor<0xi64>} : (tensor<i…
113 …%0 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %shape) {broadcast_dimensions = dense<[1, 2]> : tensor…
121 …%0 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %shape) {broadcast_dimensions = dense<[2]> : tensor<1x…
129 …%0 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %shape) {broadcast_dimensions = dense<[2]> : tensor<1x…
137 …%0 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %shape) {broadcast_dimensions = dense<[2]> : tensor<1x…
144 // expected-error@+1 {{broadcast_dimensions has rank 2 instead of rank 1}}
145 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[[1,1],[1,1]]> : tensor<2x2xi64>…
152 // expected-error@+1 {{broadcast_dimensions size (1) does not match operand rank (2)}}
153 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[1]> : tensor<1xi64>} : (tensor<…
[all …]
Dcanonicalize.mlir397 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[0, 1, 2]> : tensor<3xi64>} : (t…
404 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[0, 1]> : tensor<2xi64>} : (tens…
411 …%0 = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[1, 0]> : tensor<2xi64>} : (tens…
418 …// CHECK: %[[RESULT:.+]] = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<1> : tenso…
419 …%0 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %arg1) { broadcast_dimensions = dense<1> : tensor<1xi6…
428 …%2 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %0) { broadcast_dimensions = dense<0> : tensor<1xi64> …
438 …%2 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %1) { broadcast_dimensions = dense<0> : tensor<1xi64> …
446 …%b = "mhlo.broadcast_in_dim"(%cst) {broadcast_dimensions = dense<[]> : tensor<0xi64>} : (tensor<f3…
455 …%b = "mhlo.broadcast_in_dim"(%cst) {broadcast_dimensions = dense<[2, 3]> : tensor<2xi64>} : (tenso…
490 …OADCAST:%.+]] = "mhlo.dynamic_broadcast_in_dim"([[IOTA]], %arg0) {broadcast_dimensions = dense<0> …
[all …]
Dhlo-legalize-to-lhlo.mlir133 {broadcast_dimensions = dense<1> : tensor<1xi64>}
135 …// CHECK: "lmhlo.broadcast_in_dim"(%{{.*}}, %{{.*}}) {broadcast_dimensions = dense<1> : tensor<1xi…
149 broadcast_dimensions = dense<[1, 2]> : tensor<2xi64>
641 …%5 = "mhlo.dynamic_broadcast_in_dim"(%0, %4) {broadcast_dimensions = dense<> : tensor<0xi64>} : (t…
642 …%6 = "mhlo.dynamic_broadcast_in_dim"(%arg0, %4) {broadcast_dimensions = dense<0> : tensor<1xi64>} …
/external/tensorflow/tensorflow/compiler/xla/client/
Dxla_builder.h457 const absl::Span<const int64> broadcast_dimensions);
929 absl::Span<const int64> broadcast_dimensions,
958 absl::Span<const int64> broadcast_dimensions);
1063 const absl::Span<const int64> broadcast_dimensions);
1113 absl::Span<const int64> broadcast_dimensions,
1116 absl::Span<const int64> broadcast_dimensions,
1238 absl::Span<const int64> broadcast_dimensions);
1241 absl::Span<const int64> broadcast_dimensions);
1243 absl::Span<const int64> broadcast_dimensions);
1245 absl::Span<const int64> broadcast_dimensions);
[all …]
Dxla_builder.cc552 absl::Span<const int64> broadcast_dimensions) { in InDimBroadcast() argument
557 for (int64 dim : broadcast_dimensions) { in InDimBroadcast()
581 std::vector<int64> broadcast_dimensions; in AddBroadcastSequence() local
585 broadcast_dimensions.push_back(i); in AddBroadcastSequence()
613 broadcast_dimensions); in AddBroadcastSequence()
626 absl::Span<const int64> broadcast_dimensions, in BinaryOp() argument
634 binop, *lhs_shape, *rhs_shape, broadcast_dimensions)); in BinaryOp()
641 if (!broadcast_dimensions.empty() && lhs_rank != rhs_rank) { in BinaryOp()
653 int64 to_dim = broadcast_dimensions[from_dim]; in BinaryOp()
662 InDimBroadcast(broadcasted_shape, from, broadcast_dimensions)); in BinaryOp()
[all …]
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Ddiag_op.cc67 std::vector<int64> broadcast_dimensions(other_dims.size() + 1); in CreateDiagonal() local
68 absl::c_iota(broadcast_dimensions, 0); in CreateDiagonal()
69 ++broadcast_dimensions.back(); in CreateDiagonal()
71 xla::BroadcastInDim(input, out_dim_sizes, broadcast_dimensions); in CreateDiagonal()
Dselect_op.cc68 std::vector<int64> broadcast_dimensions(cond_shape.dims()); in Compile() local
69 absl::c_iota(broadcast_dimensions, 0); in Compile()
71 broadcast_dimensions); in Compile()
Dmatrix_diag_ops.cc158 std::vector<int64> broadcast_dimensions(input_rank - 1); in SetMatrixDiag() local
159 absl::c_iota(broadcast_dimensions, 0); in SetMatrixDiag()
191 broadcast_dimensions.back() = input_rank - 1; // Column-wise. in SetMatrixDiag()
193 broadcast_dimensions.back() = input_rank - 2; // Row-wise. in SetMatrixDiag()
199 broadcast_dimensions.back() = input_rank - 2; // Row-wise. in SetMatrixDiag()
202 broadcast_dimensions.back() = input_rank - 1; // Column-wise. in SetMatrixDiag()
221 diag_slice, input_shape.dim_sizes(), broadcast_dimensions); in SetMatrixDiag()
/external/tensorflow/tensorflow/compiler/mlir/xla/tests/translate/
Dfully_connected_reference_model.hlotxt26 …// CHECK-NEXT: %[[VAL_6:.*]] = "mhlo.broadcast_in_dim"(%[[VAL_5]]) {broadcast_dimensions = dense<[…
32 …// CHECK-NEXT: %[[VAL_8:.*]] = "mhlo.broadcast_in_dim"(%[[VAL_7]]) {broadcast_dimensions = dense<>…
41 …// CHECK-NEXT: %[[VAL_11:.*]] = "mhlo.broadcast_in_dim"(%[[VAL_10]]) {broadcast_dimensions = dense…
50 …// CHECK-NEXT: %[[VAL_14:.*]] = "mhlo.broadcast_in_dim"(%[[VAL_13]]) {broadcast_dimensions = dense…
56 …// CHECK-NEXT: %[[VAL_16:.*]] = "mhlo.broadcast_in_dim"(%[[VAL_15]]) {broadcast_dimensions = dense…
84 …// CHECK-NEXT: %[[VAL_25:.*]] = "mhlo.broadcast_in_dim"(%[[VAL_24]]) {broadcast_dimensions = dense…
/external/tensorflow/tensorflow/compiler/xla/service/
Dhlo_creation_utils.h104 absl::Span<const int64> broadcast_dimensions,
107 absl::Span<const int64> broadcast_dimensions,
285 absl::Span<const int64> broadcast_dimensions);
290 absl::Span<const int64> broadcast_dimensions);
Dshape_inference.cc780 absl::Span<const int64> broadcast_dimensions) { in InferInDimBroadcastShape() argument
781 if (broadcast_dimensions.empty() && !ShapeUtil::IsScalar(smaller_shape)) { in InferInDimBroadcastShape()
788 } else if (broadcast_dimensions.size() != smaller_shape.rank()) { in InferInDimBroadcastShape()
794 smaller_shape.rank(), broadcast_dimensions.size()); in InferInDimBroadcastShape()
840 int64 dimension_to_match = broadcast_dimensions.at(i); in InferInDimBroadcastShape()
882 if (i > 0 && broadcast_dimensions.at(i - 1) >= dimension_to_match) { in InferInDimBroadcastShape()
885 dimension_to_match, broadcast_dimensions.at(i - 1)); in InferInDimBroadcastShape()
897 absl::Span<const int64> broadcast_dimensions) { in InferElementwiseBinaryOpShape() argument
911 if (!broadcast_dimensions.empty() && in InferElementwiseBinaryOpShape()
912 broadcast_dimensions != identity_dims) { in InferElementwiseBinaryOpShape()
[all …]
Dshape_inference.h58 absl::Span<const int64> broadcast_dimensions);
244 absl::Span<const int64> broadcast_dimensions);
352 absl::Span<const int64> broadcast_dimensions);
380 absl::Span<const int64> broadcast_dimensions);
Dhlo_creation_utils.cc206 absl::Span<const int64> broadcast_dimensions, in MakeBroadcastHlo() argument
213 broadcast_shape, operand, broadcast_dimensions)); in MakeBroadcastHlo()
217 absl::Span<const int64> broadcast_dimensions, in MakeBroadcastHlo() argument
219 return MakeBroadcastHlo(operand, broadcast_dimensions, shape.dimensions()); in MakeBroadcastHlo()
551 absl::Span<const int64> broadcast_dimensions) { in BroadcastZeros() argument
555 /*result_shape_bounds=*/broadcast_dimensions); in BroadcastZeros()
560 absl::Span<const int64> broadcast_dimensions) { in BroadcastOnes() argument
564 /*result_shape_bounds=*/broadcast_dimensions); in BroadcastOnes()
/external/tensorflow/tensorflow/compiler/mlir/xla/tests/
Dlegalize-tf-binary-elementwise.mlir26 …// CHECK-NEXT: %[[LHS_BCAST:.+]] = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<1>…
36 …// CHECK-NEXT: %[[LHS_BCAST:.+]] = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[1…
52 …]] = "mhlo.dynamic_broadcast_in_dim"(%arg0, %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<1> …
53 …]] = "mhlo.dynamic_broadcast_in_dim"(%arg1, %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<[0,…
221 …]] = "mhlo.dynamic_broadcast_in_dim"(%arg0, %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<0> …
222 …]] = "mhlo.dynamic_broadcast_in_dim"(%arg1, %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<0> …
231 …// CHECK-DAG: %[[LHS_BCAST:.+]] = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<1> …
302 …// CHECK-NEXT: %[[LHS_BCAST:.+]] = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<1>…
318 …]] = "mhlo.dynamic_broadcast_in_dim"(%arg0, %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<0> …
319 …]] = "mhlo.dynamic_broadcast_in_dim"(%arg1, %[[RESULT_EXTENTS]]) {broadcast_dimensions = dense<0> …
Dlegalize-tf-BatchMatMulV2.mlir18 … = "mhlo.dynamic_broadcast_in_dim"([[LHS]], [[LHSSHAPEEXTENTS]]) {broadcast_dimensions = dense<[0,…
30 // CHECK: "mhlo.dynamic_broadcast_in_dim"({{.*}}, {{.*}}) {broadcast_dimensions = dense<[…
42 // CHECK: "mhlo.dynamic_broadcast_in_dim"({{.*}}, {{.*}}) {broadcast_dimensions = dense<[…
Dlegalize-tf.mlir159 …// CHECK-NEXT: %[[add:.*]] = chlo.broadcast_add %arg4, %[[eps]] {broadcast_dimensions = dense<> : …
162 …bcast_arg3:.+]] = "mhlo.dynamic_broadcast_in_dim"(%arg3, {{.*}}) {broadcast_dimensions = dense<3> …
176 …t_mul2:.+]] = "mhlo.dynamic_broadcast_in_dim"(%[[mul2]], {{.*}}) {broadcast_dimensions = dense<3> …
218 …// CHECK-NEXT: %[[add:.*]] = chlo.broadcast_add %arg4, %[[eps]] {broadcast_dimensions = dense<> : …
221 …bcast_arg3:.+]] = "mhlo.dynamic_broadcast_in_dim"(%arg3, {{.*}}) {broadcast_dimensions = dense<3> …
235 …t_mul2:.+]] = "mhlo.dynamic_broadcast_in_dim"(%[[mul2]], {{.*}}) {broadcast_dimensions = dense<3> …
305 …// CHECK-NEXT: %[[add:.*]] = chlo.broadcast_add %arg4, %[[eps]] {broadcast_dimensions = dense<> : …
308 …bcast_arg3:.+]] = "mhlo.dynamic_broadcast_in_dim"(%arg3, {{.*}}) {broadcast_dimensions = dense<3> …
322 …t_mul2:.+]] = "mhlo.dynamic_broadcast_in_dim"(%[[mul2]], {{.*}}) {broadcast_dimensions = dense<3> …
393 …// CHECK-NEXT: %[[add:.*]] = chlo.broadcast_add %arg4, %[[eps]] {broadcast_dimensions = dense<> : …
[all …]
Dlegalize-tf-with-tf2xla.mlir85 …// CHECK: %[[BROADCAST0:.*]] = "mhlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<[1, 2]…
87 …// CHECK: %[[UPDATED_ARG0:.*]] = "mhlo.broadcast_in_dim"(%[[RESHAPE0]]) {broadcast_dimensions = de…
90 …// CHECK: %[[UPDATED_ARG1:.*]] = "mhlo.broadcast_in_dim"(%[[RESHAPE1]]) {broadcast_dimensions = de…
197 // CHECK: %[[DEFAULT:.*]] = "mhlo.broadcast_in_dim"(%[[ARG2]]) {broadcast_dimensions = dense<>…
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/tests/
Dlegalize_hlo.mlir12 …%0 = "chlo.broadcast_add"(%arg0, %arg1) {broadcast_dimensions = dense<3> : tensor<1xi64>} : (tenso…
23 …%0 = "chlo.broadcast_add"(%arg0, %arg1) {broadcast_dimensions = dense<3> : tensor<1xi64>} : (tenso…
34 …%0 = "chlo.broadcast_add"(%arg0, %arg1) {broadcast_dimensions = dense<3> : tensor<1xi64>} : (tenso…
57 …%0 = "chlo.broadcast_add"(%arg0, %arg1) {broadcast_dimensions = dense<1> : tensor<1xi64>} : (tenso…
68 …%0 = "chlo.broadcast_add"(%arg0, %arg1) {broadcast_dimensions = dense<[1, 2, 3]> : tensor<3xi64>} …
75 …%0 = "chlo.broadcast_add"(%arg0, %arg1) {broadcast_dimensions = dense<[0, 1, 2]> : tensor<3xi64>} …
96 …%0 = "chlo.broadcast_divide"(%arg0, %arg1) {broadcast_dimensions = dense<1> : tensor<1xi64>} : (te…
118 …%0 = "chlo.broadcast_divide"(%arg0, %arg1) {broadcast_dimensions = dense<1> : tensor<1xi64>} : (te…
161 …%0 = "chlo.broadcast_multiply"(%arg0, %arg1) {broadcast_dimensions = dense<1> : tensor<1xi64>} : (…
182 …%0 = "chlo.broadcast_divide"(%arg0, %arg1) {broadcast_dimensions = dense<1> : tensor<1xi64>} : (te…
[all …]
/external/tensorflow/tensorflow/compiler/mlir/hlo/include/mlir-hlo/Dialect/mhlo/IR/
Dchlo_ops.td66 // broadcasting (via the broadcast_dimensions attribute) and implicit degenerate
89 OptionalAttr<BroadcastDimAttr>:$broadcast_dimensions
94 "DenseIntElementsAttr":$broadcast_dimensions)>];
286 OptionalAttr<BroadcastDimAttr>:$broadcast_dimensions
304 OptionalAttr<BroadcastDimAttr>:$broadcast_dimensions
403 OptionalAttr<BroadcastDimAttr>:$broadcast_dimensions
669 OptionalAttr<BroadcastDimAttr>:$broadcast_dimensions,
677 "DenseIntElementsAttr":$broadcast_dimensions,
/external/tensorflow/tensorflow/compiler/mlir/hlo/include/mlir-hlo/Dialect/mhlo/transforms/
Dmhlo_passes.td78 let summary = "Test pass for materializing 'broadcast_dimensions' attributes.";
115 let summary = "Test pass for materializing 'broadcast_dimensions' attributes.";

12