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
Function
assert_tree_shape_prefix
Checks that all ``tree`` leaves' shapes have the same prefix. Args: tree: A tree to check. shape_prefix: An expected shape prefix. Raise
chex/_src/asserts.py:1291
Function
assert_tree_shape_suffix
Checks that all ``tree`` leaves' shapes have the same suffix. Args: tree: A tree to check. shape_suffix: An expected shape suffix. Raise
chex/_src/asserts.py:1332
Function
assert_trees_all_eq_comparator_jittable
Asserts all trees are equal using custom comparator. JIT-friendly.
chex/_src/asserts_internal.py:398
Function
assert_trees_all_equal_shapes_and_dtypes
Checks that trees' leaves have the same shape and dtype. Args: *trees: A sequence of (at least 2) trees to check. Raises: AssertionError
chex/_src/asserts.py:1501
Function
assert_trees_all_equal_sizes
Checks that trees have the same structure and leaves' sizes. Args: *trees: A sequence of (at least 2) trees with array leaves. Raises: A
chex/_src/asserts.py:1471
Function
assert_type
Checks that the type of all inputs matches specified ``expected_types``. If the expected type is a Python type or abstract dtype (e.g. `np.floating
chex/_src/asserts.py:786
Function
bcast_fn
(x)
chex/_src/variants.py:550
Function
check_variant_arguments
Raises `ValueError` if `variant_fn` got an unknown argument.
chex/_src/variants.py:357
Method
chex_assert_shape
(array, expected)
chex/_src/asserts_chexify_test.py:106
Function
chex_assertion
Wraps Chex assert functions to control their common behaviour. Extends the assertion to support the following optional auxiliary kwargs: custom
chex/_src/asserts_internal.py:202
Function
clear_trace_counter
Clears Chex traces' counter for ``assert_max_traces`` checks. Use it to isolate unit tests that rely on ``assert_max_traces``, by calling it at t
chex/_src/asserts.py:69
Method
compat_fn
(x, assertion=assert_compat_fn)
chex/_src/asserts_internal_test.py:124
Function
create_deprecated_function_alias
Create a deprecated alias for a function. Example usage: >>> g = create_deprecated_function_alias(f, 'path.f', 'path.g') Args: fun: the de
chex/_src/warnings.py:93
Function
dataclass
JAX-friendly wrapper for :py:func:`dataclasses.dataclass`. This wrapper class registers new dataclasses with JAX so that tree utils operate corre
chex/_src/dataclass.py:94
Function
deprecation_wrapper
Allows deprecated functions to continue running, with a warning logged.
chex/_src/asserts_internal.py:92
Function
disable_asserts
Disables all Chex assertions. Use wisely.
chex/_src/asserts.py:47
Method
dummy_wrapper
(fn)
chex/_src/asserts_internal_test.py:31
Method
dummy_wrapper
(fn)
chex/_src/asserts_test.py:186
Function
emplace
(arrays, dtype)
chex/_src/asserts_test.py:43
Function
enable_asserts
Enables Chex assertions.
chex/_src/asserts.py:55
Function
err_msg_fn
(arr_1, arr_2)
chex/_src/asserts.py:1460
Method
expected_exc_msg
(x, custom_msg)
chex/_src/asserts_internal_test.py:78
Method
f
(path, x)
chex/_src/dataclass_test.py:393
Method
f
(_)
chex/_src/fake_test.py:158
Method
f_hard_with_sg
(lr, x)
chex/_src/asserts_test.py:1821
Method
fails_for_without_device_variant
(x)
chex/_src/variants_test.py:288
Method
fake_parallel_axis_fn
(x)
chex/_src/fake_test.py:425
Function
fake_pmap_and_jit
Context manager for patching `jax.jit` and `jax.pmap`. This is a convenience function, equivalent to nested `chex.fake_pmap` and `chex.fake_jit`
chex/_src/fake.py:330
Method
finish
(self)
docs/ext/coverage_check.py:68
Function
flatten
(d)
chex/_src/dataclass.py:302
Method
fn
(op, kwargs, x, y=2.0)
chex/_src/fake_test.py:401
Method
fn
(x, y)
chex/_src/asserts_test.py:100
Method
fn
(arg_0, arg_1)
chex/_src/variants_test.py:564
Method
fn
(arg_0, arg_1, float_arg)
chex/_src/variants_test.py:707
Method
fn
(arg_0, arg_1)
chex/_src/variants_test.py:760
Method
fn
(x, y)
chex/_src/asserts_chexify_test.py:282
Method
fn
(x)
chex/_src/asserts_chexify_test.py:591
Method
fn_0
(arg_0, arg_1, kwarg_0, kwarg_1)
chex/_src/variants_test.py:612
Method
fn_1
(arg_0, arg_1, kwarg_0, kwarg_1)
chex/_src/variants_test.py:623
Method
fn_2
()
chex/_src/asserts_test.py:199
Method
fn_2
(arg_0, arg_1, kwarg_0, kwarg_1)
chex/_src/variants_test.py:634
Method
fn_3
(arg_0, arg_1)
chex/_src/variants_test.py:644
Method
fn_jitted
(x, y)
chex/_src/asserts_test.py:124
Method
fn_static
(arg_0, arg_1)
chex/_src/variants_test.py:838
Function
fn_with_counter
(*args, **kwargs)
chex/_src/variants_test.py:89
Function
fn_without_statics
(*args)
chex/_src/fake.py:168
Function
fn_wrapped
(*args, **kwargs)
chex/_src/variants.py:117
Function
fn_wrapped
(*args, **kwargs)
chex/_src/asserts.py:143
Method
fn_wrapped
(fn, *args)
chex/_src/asserts_internal_test.py:34
Method
fn_wrapped
()
chex/_src/asserts_test.py:189
Method
foo
(x)
chex/_src/fake_test.py:91
Function
format_shape_matcher
(shape: TShapeMatcher)
chex/_src/asserts_internal.py:302
Method
fu
(lr, x)
chex/_src/asserts_test.py:1825
Function
get
(x)
chex/_src/variants.py:437
Function
get_err_regex
Constructs a regexp for the exception message. Args: message: an exception message. Returns: Regexp that ensures the message follows the
chex/_src/asserts_internal.py:121
Method
get_outdated_docs
(self)
docs/ext/coverage_check.py:62
Function
get_tracers
Returns a tuple with tracers from a tree.
chex/_src/asserts_internal.py:317
Function
h1
(a, b, c)
chex/_src/warnings_test.py:38
Function
if_args_not_none
Wrap chex assertion to only be evaluated if positional args not `None`.
chex/_src/asserts.py:60
Method
incompat_fn
(x, assertion=assert_incompat_fn)
chex/_src/asserts_internal_test.py:138
Method
inner_fn
(y)
chex/_src/asserts_test.py:210
Method
inner_fn
(x, y)
chex/_src/asserts_chexify_test.py:300
Function
is_traceable
Checks if function is traceable. JAX traces a function when it is wrapped with @jit, @pmap, or @vmap. In other words, this function checks whethe
chex/_src/asserts_internal.py:330
Method
jitted_outer_fn
(x)
chex/_src/asserts_test.py:236
Function
jnp_to_np_array
Converts `jnp.ndarray` to `np.ndarray`.
chex/_src/asserts_internal.py:84
Function
linkcode_resolve
Resolve a GitHub URL corresponding to Python object.
docs/conf.py:148
Method
logp1_abs_safe
(x)
chex/_src/asserts_chexify_test.py:224
Method
make_test
(variant: ChexVariantType)
chex/_src/variants.py:182
Function
new_fun
(*args, **kwargs)
chex/_src/warnings.py:86
Function
new_init
(self, *orig_args, **orig_kwargs)
chex/_src/dataclass.py:65
Method
no_fake_parallel_axis_fn
(x)
chex/_src/fake_test.py:416
Function
num_devices_available
Returns the number of available device of the given type.
chex/_src/asserts_internal.py:306
Method
outer_fn
(x)
chex/_src/asserts_test.py:206
Method
outer_fn
(x, y)
chex/_src/asserts_chexify_test.py:304
Function
params_product
Generates a cartesian product of `params_lists`. See tests from ``variants_test.py`` for examples of usage. Args: *params_lists: A list of p
chex/_src/variants.py:84
Function
put
(x)
chex/_src/variants.py:413
Function
restrict_backends
Disallows JAX compilation for certain backends. Args: allowed: Names of backend platforms (e.g. 'cpu' or 'tpu') for which compilation is
chex/_src/restrict_backends.py:64
Method
run_test_suite
Runs a set of tests for static & value assertions. See `run_test_suite_with_log_abs_fn` for example. Args: make_test_fn: A function th
chex/_src/asserts_chexify_test.py:331
Method
setUp
(self)
chex/_src/asserts_test.py:82
Method
setUp
(self)
chex/_src/variants_test.py:381
Method
setUp
(self)
chex/_src/variants_test.py:737
Method
setUp
(self)
chex/_src/restrict_backends_test.py:30
Function
setUpModule
()
chex/_src/fake_test.py:33
Function
setUpModule
()
chex/_src/variants_test.py:52
Function
set_n_cpu_devices
Forces XLA to use `n` CPU threads as host devices. This allows `jax.pmap` to be tested on a single-CPU platform. This utility only takes effect b
chex/_src/fake.py:54
Function
setup
(app: application.Sphinx)
docs/ext/coverage_check.py:113
Method
some_method
(self, *args)
chex/_src/dataclass_test.py:103
Method
some_method
(self, *args)
chex/_src/dataclass_test.py:116
Method
some_method
(self, *args)
chex/_src/dataclass_test.py:134
Method
take_by_index_and_div
(x, i, y)
chex/_src/asserts_chexify_test.py:238
Method
test
(self, *args, **kwargs)
chex/_src/variants.py:185
Method
testFlattenAndUnflatten
(self, test_type)
chex/_src/dataclass_test.py:219
Method
testFlattenUpTo
(self, test_type)
chex/_src/dataclass_test.py:235
Method
testFlattenWithPath
(self, test_type)
chex/_src/dataclass_test.py:244
Method
testFlattenWithPathUpTo
(self, test_type)
chex/_src/dataclass_test.py:253
Method
testIsDataclass
(self, test_type)
chex/_src/dataclass_test.py:346
Method
testMapStructure
(self, test_type)
chex/_src/dataclass_test.py:263
Method
testMapStructureUpTo
(self, test_type)
chex/_src/dataclass_test.py:276
Method
testMapStructureWithPath
(self, test_type)
chex/_src/dataclass_test.py:295
Method
testMapStructureWithPathUpTo
(self, test_type)
chex/_src/dataclass_test.py:309
← previous
next →
201–300 of 578, ranked by callers