| 23 | namespace { |
| 24 | |
| 25 | string MatMulBCastToStr(const MatMulBCast& b) { |
| 26 | if (!b.IsValid()) { |
| 27 | return "invalid"; |
| 28 | } |
| 29 | string ret; |
| 30 | strings::StrAppend( |
| 31 | &ret, "[", absl::StrJoin(b.output_batch_shape().dim_sizes(), ","), "]"); |
| 32 | strings::StrAppend(&ret, "[", absl::StrJoin(b.x_batch_indices(), ","), "]"); |
| 33 | strings::StrAppend(&ret, "[", absl::StrJoin(b.y_batch_indices(), ","), "]"); |
| 34 | return ret; |
| 35 | } |
| 36 | |
| 37 | TEST(MatMulBCastTest, SimpleBroadcast) { |
| 38 | MatMulBCast bcast({1, 5, 3}, {4, 3, 7}); |