Skip to content

Commit

Permalink
Update error message checked in bitcast_op_test
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 407098953
Change-Id: Iff698c7756e1c9cfa612feb9030cce5604938690
  • Loading branch information
sagunb authored and tensorflower-gardener committed Nov 2, 2021
1 parent b735112 commit 09b3e01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tensorflow/python/kernel_tests/array_ops/bitcast_op_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ def testSameSize(self):
def testErrors(self):
x = np.zeros([1, 1], np.int8)
datatype = dtypes.int32
with self.assertRaisesRegex((ValueError, errors.InvalidArgumentError),
"Cannot bitcast from 6 to 3"):
# When eager_op_as_function is enabled shape inference will raise
# a different more informative error message.
with self.assertRaisesRegex(
(ValueError, errors.InvalidArgumentError),
"Cannot bitcast from 6 to 3|convert from s8.* to S32"):
array_ops.bitcast(x, datatype, None)

def testEmpty(self):
Expand Down

0 comments on commit 09b3e01

Please sign in to comment.