Fixed misleading error message

This error can happen for both reference and resource edges.

PiperOrigin-RevId: 349605354
Change-Id: I8442af8b8a8823d199ab39744c9d0ccd125b30bb
This commit is contained in:
Michael Gester 2020-12-30 14:55:04 -08:00 committed by TensorFlower Gardener
parent c08face2b4
commit 2b78c2d76d
2 changed files with 8 additions and 8 deletions
tensorflow/core/common_runtime

View File

@ -702,11 +702,11 @@ Status ColocationGraph::ColocateResourceOrRefEdge(const Node* src,
Status status = ColocateNodes(*src, src_root_id, *dst, dst_root_id);
if (!status.ok()) {
return AttachDef(
errors::InvalidArgument("Nodes were connected by a "
"reference connection (requiring them to "
"be on the same device), but the two nodes "
"were assigned two different devices: ",
status.error_message()),
errors::InvalidArgument(
"Nodes were connected by a reference or resource connection "
"(requiring them to be on the same device), but the two nodes "
"were assigned two different devices: ",
status.error_message()),
*dst);
}
return Status::OK();

View File

@ -2972,9 +2972,9 @@ TEST_F(NestedPlacerTest, NestedTwoFunctionsBackToBack) {
EXPECT_EQ(error::INVALID_ARGUMENT, s.code()) << s.ToString();
EXPECT_TRUE(absl::StrContains(
s.error_message(),
"Nodes were connected by a reference connection (requiring them to be on "
"the same device), but the two nodes were assigned two different "
"devices"))
"Nodes were connected by a reference or resource connection (requiring "
"them to be on the same device), but the two nodes were assigned two "
"different devices"))
<< s.ToString();
}