Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/google-deepmind/chex
/ functions
Functions
578 in github.com/google-deepmind/chex
⨍
Functions
578
◇
Types & classes
103
↳
Endpoints
2
Method
__delitem__
(self, key: str)
chex/_src/dimensions.py:192
Method
__eq__
(self, other)
chex/_src/dataclass_test.py:684
Method
__getitem__
(self, key: str)
chex/_src/dimensions.py:147
Method
__init__
(self, **dim_sizes)
chex/_src/dimensions.py:133
Method
__init__
(self)
chex/_src/fake_test.py:436
Method
__init__
(self, test_object, which_variants)
chex/_src/variants.py:128
Method
__init__
(self, name, fn)
chex/_src/variants.py:616
Method
__init__
( self, init=True, repr=True, # pylint: disable=redefined-builtin eq=True, orde
chex/_src/dataclass.py:149
Method
__init__
Creates a new OnCallOfTransformedFunction context manager. Args: fn_transformation: identifier of the function transformation e.g.
chex/_src/fake.py:390
Method
__iter__
Generate chex variants for each test case.
chex/_src/variants.py:232
Method
__name__
(self)
chex/_src/variants.py:144
Method
__post_init__
(self)
chex/_src/dataclass_test.py:56
Method
__repr__
(self)
chex/_src/dimensions.py:197
Method
__repr__
(self)
chex/_src/variants.py:620
Method
__setitem__
(self, key: str, value: Collection[Optional[int]])
chex/_src/dimensions.py:182
Method
__str__
(self)
chex/_src/variants.py:77
Method
_abs
(tree)
chex/_src/asserts_chexify_test.py:486
Function
_assert_noop
No-op.
chex/_src/asserts_chexify_test.py:59
Function
_assert_on_host
(*args, custom_message: Optional[str] = None, custom_message_forma
chex/_src/asserts_internal.py:159
Function
_assert_tree_all_finite_jittable
A jittable version of `_assert_tree_all_finite_static`.
chex/_src/asserts.py:1534
Function
_assert_tree_all_finite_static
Checks that all leaves in a tree are finite. Args: tree_like: A pytree with array leaves. Raises: AssertionError: If any leaf in ``tree_
chex/_src/asserts.py:1517
Function
_assert_tree_positive
(tree)
chex/_src/asserts_chexify_test.py:71
Function
_assert_trees_all_close_jittable
A jittable version of `_assert_trees_all_close_static`.
chex/_src/asserts.py:1696
Function
_assert_trees_all_close_static
Checks that all trees have leaves with approximately equal values. This compares the difference between values of actual and desired up to ``ato
chex/_src/asserts.py:1644
Function
_assert_trees_all_close_ulp_jittable
A dummy jittable version of `_assert_trees_all_close_ulp_static`. JAX does not yet have a native version of assert_array_max_ulp, so at the momen
chex/_src/asserts.py:1825
Function
_assert_trees_all_close_ulp_static
Checks that tree leaves differ by at most `maxulp` Units in the Last Place. This is the Chex version of np.testing.assert_array_max_ulp. Asserti
chex/_src/asserts.py:1739
Function
_assert_trees_all_equal_jittable
A jittable version of `_assert_trees_all_equal_static`.
chex/_src/asserts.py:1617
Function
_assert_trees_all_equal_static
Checks that all trees have leaves with *exactly* equal values. If you are comparing floating point numbers, an exact equality check may not be ap
chex/_src/asserts.py:1557
Function
_check
(pred, msg, *fmt_args, **fmt_kwargs)
chex/_src/asserts_internal.py:249
Function
_check_if_hanging_assertions
()
chex/_src/asserts_chexify.py:75
Function
_chex_assert_fn
(*args, custom_message: Optional[str] = None, custom_message_forma
chex/_src/asserts_internal.py:232
Method
_chexified_assert_fn
(x)
chex/_src/asserts_chexify_test.py:140
Function
_chexified_fn
(*args, **kwargs)
chex/_src/asserts_chexify.py:186
Function
_dataclass_unflatten
Creates a chex dataclass from a flatten jax.tree_util representation.
chex/_src/dataclass.py:262
Function
_fake
(*args, axis_index_groups=None, **kwargs)
chex/_src/fake.py:106
Function
_fake_pmap
Fake implementation of pmap using vmap.
chex/_src/fake.py:124
Function
_flatten_with_path
(dcls)
chex/_src/dataclass.py:278
Method
_format
(*devs)
chex/_src/asserts_test.py:1360
Method
_from_tuple
(args)
chex/_src/dataclass.py:205
Method
_getstate
(self)
chex/_src/dataclass.py:214
Method
_init
(self, *args, **kwargs)
chex/_src/dataclass.py:248
Function
_is_leaf
(value)
chex/_src/asserts.py:1022
Method
_is_leaf
(value)
chex/_src/dataclass_test.py:633
Function
_jittable_assert_tree_positive
(tree)
chex/_src/asserts_chexify_test.py:77
Method
_make_log_fn
(assert_input_fn: _ai.TChexAssertion)
chex/_src/asserts_chexify_test.py:459
Method
_new_fn_transformation
Returns a transformed version of the given function.
chex/_src/fake.py:406
Method
_new_transformed_fn
Returns result of the returned function and calls the callback.
chex/_src/fake.py:411
Method
_pos_sq
(x)
chex/_src/asserts_chexify_test.py:155
Method
_pos_sum
(x_1, x_2)
chex/_src/asserts_chexify_test.py:137
Method
_pure_log_fn
(tree_1, tree_2)
chex/_src/asserts_chexify_test.py:461
Function
_reduce_leaf
(leaf)
chex/_src/variants.py:502
Method
_replace
(self, **kwargs)
chex/_src/dataclass.py:211
Method
_run_tests_in_thread
()
chex/_src/asserts_chexify_test.py:437
Method
_setstate
(self, state)
chex/_src/dataclass.py:239
Method
_sum_fn
(tree)
chex/_src/asserts_chexify_test.py:111
Function
_test_fn_single_device
(arg_0, arg_1)
chex/_src/variants_test.py:717
Method
_to_tuple
(self)
chex/_src/dataclass.py:208
Function
_wait_checks
()
chex/_src/asserts_chexify.py:225
Function
_with_device
Variant that applies `jax.device_put` to the args of fn.
chex/_src/variants.py:402
Function
_with_jit
Variant that applies `jax.jit` to fn.
chex/_src/variants.py:372
Function
_with_pmap
Variant that applies `jax.pmap` to fn. Args: fn: A function to wrap. broadcast_args_to_devices: Whether to broadcast `fn` args to pmap form
chex/_src/variants.py:451
Function
_without_device
Variant that applies `jax.device_get` to the args of fn.
chex/_src/variants.py:431
Function
_without_jit
Variant that does not apply `jax.jit` to a fn (identity).
chex/_src/variants.py:390
Function
all_variants
Equivalent to ``chex.variants`` but with flipped defaults.
chex/_src/variants.py:340
Function
assert_axis_dimension
Checks that ``tensor.shape[axis] == expected``. Args: tensor: A JAX array. axis: An integer specifying which axis to assert. expected:
chex/_src/asserts.py:885
Function
assert_axis_dimension_gt
Checks that ``tensor.shape[axis] > val``. Args: tensor: A JAX array. axis: An integer specifying which axis to assert. val: A value ``t
chex/_src/asserts.py:905
Function
assert_axis_dimension_gteq
Checks that ``tensor.shape[axis] >= val``. Args: tensor: A JAX array. axis: An integer specifying which axis to assert. val: A value ``
chex/_src/asserts.py:924
Function
assert_axis_dimension_lt
Checks that ``tensor.shape[axis] < val``. Args: tensor: A JAX Array. axis: An integer specifiying which axis to assert. val: A value ``
chex/_src/asserts.py:943
Function
assert_axis_dimension_lteq
Checks that ``tensor.shape[axis] <= val``. Args: tensor: A JAX array. axis: An integer specifying which axis to assert. val: A value ``
chex/_src/asserts.py:962
Function
assert_collection_of_arrays
Checks if ``inputs`` is a collection of arrays.
chex/_src/asserts_internal.py:78
Function
assert_devices_available
Checks that `n` devices of a given type are available. Args: n: A required number of devices of the given type. devtype: A type of devices,
chex/_src/asserts.py:165
Method
assert_each_positive
(*args)
chex/_src/asserts_internal_test.py:69
Function
assert_equal
Checks that the two objects are equal as determined by the `==` operator. Arrays with more than one element cannot be compared. Use ``assert_tree
chex/_src/asserts.py:220
Function
assert_equal_rank
Checks that all arrays have the same rank. Args: inputs: A collection of arrays. Raises: AssertionError: If the ranks of all arrays do n
chex/_src/asserts.py:682
Function
assert_equal_shape
Checks that all arrays have the same shape. Args: inputs: A collection of arrays. dims: An optional integer or sequence of integers. If not
chex/_src/asserts.py:452
Function
assert_equal_shape_prefix
Checks that the leading ``prefix_dims`` dims of all inputs have same shape. Args: inputs: A collection of input arrays. prefix_len: A numbe
chex/_src/asserts.py:499
Function
assert_equal_shape_suffix
Checks that the final ``suffix_len`` dims of all inputs have same shape. Args: inputs: A collection of input arrays. suffix_len: A number o
chex/_src/asserts.py:520
Function
assert_equal_size
Checks that all arrays have the same size. Args: inputs: A collection of arrays. Raises: AssertionError: If the size of all arrays do no
chex/_src/asserts.py:371
Function
assert_exactly_one_is_none
Checks that one and only one of the arguments is `None`. Args: first: A first object. second: A second object. Raises: AssertionErro
chex/_src/asserts.py:253
Method
assert_fn
(x)
chex/_src/asserts_internal_test.py:110
Function
assert_gpu_available
Checks that at least one GPU device is available. Args: backend: A type of backend to use (uses JAX default if not provided). Raises: As
chex/_src/asserts.py:206
Function
assert_is_broadcastable
Checks that an array of ``shape_a`` is broadcastable to one of ``shape_b``. Args: shape_a: A shape of the array to check. shape_b: A target
chex/_src/asserts.py:658
Function
assert_is_divisible
Checks that ``numerator`` is divisible by ``denominator``. Args: numerator: A numerator. denominator: A denominator. Raises: Asserti
chex/_src/asserts.py:269
Function
assert_leaves_all_eq_comparator
Asserts all leaves are equal using custom comparator. Not jittable.
chex/_src/asserts_internal.py:387
Function
assert_max_traces
Checks that a function is traced at most `n` times (inclusively). JAX re-traces jitted functions every time the structure of passed arguments cha
chex/_src/asserts.py:78
Function
assert_not_both_none
Checks that at least one of the arguments is not `None`. Args: first: A first object. second: A second object. Raises: AssertionErro
chex/_src/asserts.py:237
Function
assert_numerical_grads
Checks that autodiff and numerical gradients of a function match. Args: f: A function to check. f_args: Arguments of the function. orde
chex/_src/asserts.py:981
Method
assert_positive
(x)
chex/_src/asserts_internal_test.py:64
Function
assert_rank
Checks that the rank of all inputs matches specified ``expected_ranks``. Valid usages include: .. code-block:: python assert_rank(x, 0)
chex/_src/asserts.py:702
Function
assert_scalar_in
Checks that argument is a scalar within segment (by default). Args: x: An object to check. min_: A left border of the segment. max_: A
chex/_src/asserts.py:298
Function
assert_scalar_negative
Checks that a scalar is negative. Args: x: A value to check. Raises: AssertionError: If ``x`` is not a scalar or strictly negative.
chex/_src/asserts.py:356
Function
assert_scalar_positive
Checks that a scalar is positive. Args: x: A value to check. Raises: AssertionError: If ``x`` is not a scalar or strictly positive.
chex/_src/asserts.py:326
Function
assert_shape
Checks that the shape of all inputs matches specified ``expected_shapes``. Valid usages include: .. code-block:: python assert_shape(x, ())
chex/_src/asserts.py:598
Function
assert_size
Checks that the size of all inputs matches specified ``expected_sizes``. Valid usages include: .. code-block:: python assert_size(x, 1)
chex/_src/asserts.py:389
Function
assert_tpu_available
Checks that at least one TPU device is available. Args: backend: A type of backend to use (uses JAX default if not provided). Raises: As
chex/_src/asserts.py:192
Function
assert_tree_is_on_device
Checks that all leaves are ndarrays residing in device memory (in HBM). Sharded DeviceArrays are disallowed. Args: tree: A tree to assert.
chex/_src/asserts.py:1151
Function
assert_tree_is_on_host
Checks that all leaves are ndarrays residing in the host memory (on CPU). This assertion only accepts trees consisting of ndarrays. Args: tr
chex/_src/asserts.py:1077
Function
assert_tree_is_sharded
Checks that all leaves are ndarrays sharded across the specified devices. Args: tree: A tree to assert. devices: A list of devices which th
chex/_src/asserts.py:1215
Function
assert_tree_no_nones
Checks that a tree does not contain `None`. Args: tree: A tree to assert. Raises: AssertionError: If the tree contains at least one `Non
chex/_src/asserts.py:1011
Function
assert_tree_shape
Checks that all ``tree`` leaves match the ``expected_shape``. Args: tree: A tree to check. expected_shape: An expected shape. See ``chex.as
chex/_src/asserts.py:1263
← previous
next →
101–200 of 578, ranked by callers