MCPcopy Create free account

hub / github.com/google-deepmind/chex / functions

Functions578 in github.com/google-deepmind/chex

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
Functionall_variants
Equivalent to ``chex.variants`` but with flipped defaults.
chex/_src/variants.py:340
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_collection_of_arrays
Checks if ``inputs`` is a collection of arrays.
chex/_src/asserts_internal.py:78
Functionassert_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
Methodassert_each_positive
(*args)
chex/_src/asserts_internal_test.py:69
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Methodassert_fn
(x)
chex/_src/asserts_internal_test.py:110
Functionassert_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
Functionassert_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
Functionassert_is_divisible
Checks that ``numerator`` is divisible by ``denominator``. Args: numerator: A numerator. denominator: A denominator. Raises: Asserti
chex/_src/asserts.py:269
Functionassert_leaves_all_eq_comparator
Asserts all leaves are equal using custom comparator. Not jittable.
chex/_src/asserts_internal.py:387
Functionassert_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
Functionassert_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
Functionassert_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
Methodassert_positive
(x)
chex/_src/asserts_internal_test.py:64
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
Functionassert_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
← previousnext →101–200 of 578, ranked by callers