Skip to content

Commit

Permalink
make boxes non-diff-able
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyas committed Aug 3, 2022
1 parent 830adc4 commit c22c40a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tox/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
import jax.numpy as jnp


class Box(NamedTuple):
low: jnp.ndarray
high: jnp.ndarray
shape: Tuple
class Box:

def __init__(self, low: jnp.ndarray, high: jnp.ndarray, shape: Tuple):
self.low = low
self.high = high
self.shape = shape

def clip(self, x: jnp.ndarray) -> jnp.ndarray:
return jnp.clip(x, self.low, self.high)
Expand Down

0 comments on commit c22c40a

Please sign in to comment.