Skip to content

Commit

Permalink
Updates a test case for NumPy 2.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 677980827
  • Loading branch information
dusenberrymw authored and edward-bot committed Sep 23, 2024
1 parent 1600fa7 commit 167767b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions edward2/tensorflow/random_variable_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ def testStr(self):

def testRepr(self):
x = ed.RandomVariable(tfp.distributions.Normal(0.0, 1.0), value=1.234)
string = ("<ed.RandomVariable '{name}' shape=() "
"dtype=float32 numpy=1.234>".format(name=x.distribution.name))
string = (
"<ed.RandomVariable '{name}' shape=() "
"dtype=float32 numpy=np.float32(1.234)>".format(
name=x.distribution.name
)
)
self.assertEqual(repr(x), string)

def testNumpy(self):
Expand Down

0 comments on commit 167767b

Please sign in to comment.