def testCustomRewardFn(self):
    obs_spec = array_spec.BoundedArraySpec((2, 3), np.int32, (- 10), 10)
    batch_size = 3
    env = random_py_environment.RandomPyEnvironment(obs_spec, reward_fn=(lambda *_: np.ones(batch_size)), batch_size=batch_size)
    env._done = False
    env.reset()
    time_step = env.step([0])
    self.assertSequenceAlmostEqual(([1.0] * 3), time_step.reward)
def testCustomRewardFn(self):
    obs_spec = array_spec.BoundedArraySpec((2, 3), np.int32, (- 10), 10)
    batch_size = 3
    env = random_py_environment.RandomPyEnvironment(obs_spec, reward_fn=(lambda *_: np.ones(batch_size)), batch_size=batch_size)
    env._done = False
    env.reset()
    time_step = env.step([0])
    self.assertSequenceAlmostEqual(([1.0] * 3), time_step.reward)