[XLA] No-op reshapes should not return true for inserting or deleting one-sized
dimensions. PiperOrigin-RevId: 334206368 Change-Id: I4ba86171812aafcaf9ece282ac05bdd01e914fb1
This commit is contained in:
parent
44a568d101
commit
e31695e95f
@ -1074,7 +1074,8 @@ ShapeUtil::InsertedOrDeleted1SizedDimensions(const Shape& shape_pre,
|
||||
}
|
||||
}
|
||||
|
||||
return std::make_tuple(true, deleted_indices, inserted_indices);
|
||||
return std::make_tuple(!deleted_indices.empty() || !inserted_indices.empty(),
|
||||
deleted_indices, inserted_indices);
|
||||
}
|
||||
|
||||
/* static */ std::vector<std::pair<int64, int64>>
|
||||
|
@ -558,6 +558,8 @@ TEST(ShapeUtilTest, InsertedOrDeleted1SizedDimensions) {
|
||||
ShapeUtil::InsertedOrDeleted1SizedDimensions(shape0, shape1)));
|
||||
EXPECT_FALSE(std::get<0>(
|
||||
ShapeUtil::InsertedOrDeleted1SizedDimensions(shape0, shape2)));
|
||||
EXPECT_FALSE(std::get<0>(
|
||||
ShapeUtil::InsertedOrDeleted1SizedDimensions(shape0, shape0)));
|
||||
}
|
||||
|
||||
TEST(ShapeUtilTest, ForEachIndex) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user