コード例 #1
0
 def padded_sum(x):
     return np.sum(x) / shape_as_value(x.shape)[0]
コード例 #2
0
 def test_mean(self):
   self.check(lambda x: jnp.sum(x) / shape_as_value(x.shape)[0], ['n'], '',
              {'n': 3}, [(4,)], ['float_'],
              jtu.rand_default(self.rng()))
コード例 #3
0
 def test_mean(self):
     # TODO Shapecheck fails - shape_as_value can't deal with abstract eval yet
     raise SkipTest
     self.check(lambda x: jnp.sum(x) / shape_as_value(x.shape)[0], ['n'],
                '', {'n': 3}, [(4, )], ['float_'],
                jtu.rand_default(self.rng()))