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