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
↓ 29 callers
Method
variant
Raises a RuntimeError if not overriden or redefined.
chex/_src/variants.py:58
↓ 18 callers
Function
as_arrays
(arrays)
chex/_src/asserts_test.py:35
↓ 13 callers
Function
assert_fn
(arr_1, arr_2)
chex/_src/asserts.py:1573
↓ 12 callers
Function
compute_cube
(side)
chex/_src/restrict_backends_test.py:23
↓ 12 callers
Function
dummy_dataclass
(factor=1., frozen=False)
chex/_src/dataclass_test.py:80
↓ 10 callers
Method
_init_testdata
Initializes test data.
chex/_src/dataclass_test.py:155
↓ 9 callers
Function
_scalar_to_ndarray
(x, shape=None)
chex/_src/variants_test.py:58
↓ 8 callers
Function
_device_put_replicated
(x, devices)
chex/_src/asserts_test.py:47
↓ 8 callers
Function
exec_with_tracing_counter_checks
(self, var_fn, arg_0, arg_1)
chex/_src/variants_test.py:94
↓ 7 callers
Function
_assert_fn
(path, leaf)
chex/_src/asserts.py:1045
↓ 7 callers
Function
_ignore_axis_index_groups
Wrapper that forces axis_index_groups to be None. This is to avoid problems within fake_pmap where parallel operations are performed with vmap, r
chex/_src/fake.py:91
↓ 6 callers
Function
_assert_jitted
Asserts that a function can be jitted or not. Args: fn: The function to be tested fn_input: Input to pass to the function is_jitted: As
chex/_src/fake_test.py:37
↓ 6 callers
Function
assert_trees_all_equal_comparator
Checks that all trees are equal as per the custom comparator for leaves. Args: equality_comparator: A custom function that accepts two leaves a
chex/_src/asserts.py:1401
↓ 5 callers
Function
_assert_pmapped
Asserts whether a function can be pmapped or not. Args: fn: The function to be tested fn_input: Input to pass to the function is_pmappe
chex/_src/fake_test.py:52
↓ 5 callers
Function
_variant_default_tests_generator
Returns a generator with standard tests. For internal usage. Allows to dynamically generate common tests. See tests' names and comments for more
chex/_src/variants_test.py:62
↓ 5 callers
Function
assert_axis_dimension_comparator
Asserts that `pass_fn(tensor.shape[axis])` passes. Used to implement ==, >, >=, <, <= checks. Args: tensor: A JAX array. axis: An intege
chex/_src/asserts.py:853
↓ 5 callers
Function
dcls
(cls)
chex/_src/dataclass.py:135
↓ 5 callers
Method
run_test_suite_with_log_abs_fn
Generates valid and invalid inputs for log_abs_fn and runs the tests.
chex/_src/asserts_chexify_test.py:401
↓ 5 callers
Method
start
(self)
chex/_src/fake.py:209
↓ 4 callers
Method
_assert_tree_structs_validation
Checks that assert_fn correctly processes invalid args' structs.
chex/_src/asserts_test.py:862
↓ 4 callers
Method
_test_fn
(self, fn, init_args, seed, n=10)
chex/_src/asserts_test.py:1797
↓ 4 callers
Function
assert_scalar
Checks that ``x`` is a scalar, as defined in `pytypes.py` (int or float). Args: x: An object to check. Raises: AssertionError: If ``x``
chex/_src/asserts.py:284
↓ 4 callers
Function
get_chexify_err_regex
(name, msg)
chex/_src/asserts_chexify_test.py:52
↓ 4 callers
Function
rank_array
(n)
chex/_src/asserts_test.py:551
↓ 4 callers
Method
stop
(self)
chex/_src/fake.py:212
↓ 3 callers
Function
_check_error
Checks the error and converts it to chex format.
chex/_src/asserts_chexify.py:49
↓ 3 callers
Function
_check_sharding
(x)
chex/_src/asserts.py:1061
↓ 3 callers
Function
_dataclass_instance_fields
Serialization-friendly version of dataclasses.fields for instances.
chex/_src/dataclass_test.py:89
↓ 3 callers
Method
_device_count
(self, backend)
chex/_src/asserts_test.py:1731
↓ 3 callers
Function
_unelided_shape_matches
Returns True if `actual_shape` is compatible with `expected_shape`.
chex/_src/asserts.py:540
↓ 3 callers
Method
_validate_key
(self, key: Any)
chex/_src/dimensions.py:230
↓ 3 callers
Function
assert_tree_has_only_ndarrays
Checks that all `tree`'s leaves are n-dimensional arrays (tensors). Args: tree: A tree to assert. Raises: AssertionError: If the tree co
chex/_src/asserts.py:1034
↓ 3 callers
Function
f
(a, b, c)
chex/_src/warnings_test.py:24
↓ 3 callers
Function
inner_fn
(*args, **kwargs)
chex/_src/asserts_internal.py:95
↓ 3 callers
Function
mappable_dataclass
Exposes dataclass as ``collections.abc.Mapping`` descendent. Allows to traverse dataclasses in methods from `dm-tree` library. NOTE: changes dat
chex/_src/dataclass.py:31
↓ 3 callers
Function
register_dataclass_type_with_jax_tree_util
Register an existing dataclass so JAX knows how to handle it. This means that functions in jax.tree_util operate over the fields of the dataclass
chex/_src/dataclass.py:289
↓ 3 callers
Method
size
Returns the flat size of a given named shape, i.e. prod(shape).
chex/_src/dimensions.py:137
↓ 2 callers
Function
_restrict_by_attr_name
Patch the given backend restriction onto getattr(compiler, name).
chex/_src/restrict_backends.py:42
↓ 2 callers
Method
_setdim
(self, dim: str, size: Optional[int])
chex/_src/dimensions.py:215
↓ 2 callers
Function
_shape_matches
Returns True if `actual_shape` is compatible with `expected_shape`.
chex/_src/asserts.py:557
↓ 2 callers
Method
_validate_dim
(self, dim: Any)
chex/_src/dimensions.py:240
↓ 2 callers
Function
_variants_fn
Implements `variants` and `all_variants`.
chex/_src/variants.py:238
↓ 2 callers
Function
array_from_shape
(*shape)
chex/_src/asserts_test.py:39
↓ 2 callers
Function
extract_relevant_dims
(shape, dims)
chex/_src/asserts.py:474
↓ 2 callers
Method
setUp
(self)
chex/_src/variants_test.py:259
↓ 2 callers
Function
wrapped_fn
(*args, **kwargs)
chex/_src/fake.py:147
↓ 2 callers
Method
write
(self, *ignored: Any)
docs/ext/coverage_check.py:65
↓ 1 callers
Method
__enter__
(self)
chex/_src/fake.py:404
↓ 1 callers
Method
__exit__
(self, *unused_args)
chex/_src/fake.py:422
↓ 1 callers
Method
__post_init__
(self, k_init_only)
chex/_src/dataclass_test.py:137
↓ 1 callers
Function
_add_annotations_import
Appends a future annotations import to the file at the given path.
docs/conf.py:34
↓ 1 callers
Method
_asdict
(self)
chex/_src/dimensions.py:201
↓ 1 callers
Function
_bfloat16_nulp_diff
Number of representable bf16 points between each item in x and y.
chex/_src/asserts.py:1725
↓ 1 callers
Function
_cmp_leaves
(path, *leaves)
chex/_src/asserts_internal.py:420
↓ 1 callers
Function
_convert_key_fn
(key: JaxKeyType)
chex/_src/asserts_internal.py:465
↓ 1 callers
Method
_deldim
(self, dim: str)
chex/_src/dimensions.py:221
↓ 1 callers
Function
_device_put_replicated
(x, devices)
chex/_src/asserts_chexify_test.py:40
↓ 1 callers
Function
_get_mappable_dataclasses
Generates shallow and nested mappable dataclasses.
chex/_src/dataclass_test.py:107
↓ 1 callers
Method
_getdim
(self, dim: str)
chex/_src/dimensions.py:205
↓ 1 callers
Method
_init
Initializes common test cases.
chex/_src/asserts_test.py:86
↓ 1 callers
Method
_inner_iter
Generate chex variants for a single test.
chex/_src/variants.py:179
↓ 1 callers
Function
_make_host_assertion
Constructs a host assertion given `assert_fn`. This wrapper should only be applied to the assertions that are either a) never used in jitted co
chex/_src/asserts_internal.py:139
↓ 1 callers
Function
_optional_int
(x: Any)
chex/_src/dimensions.py:250
↓ 1 callers
Function
_recursive_add_annotations_import
()
docs/conf.py:54
↓ 1 callers
Method
_set_test_name
Set a name for the generated test.
chex/_src/variants.py:157
↓ 1 callers
Function
_test_fn_with_device
(arg_0, arg_1)
chex/_src/variants_test.py:680
↓ 1 callers
Function
_test_fn_without_device
(arg_0, arg_1)
chex/_src/variants_test.py:658
↓ 1 callers
Function
_tree_error_msg_fn
( path: Tuple[Union[int, str, Hashable]], i_1: int, i_2: int)
chex/_src/asserts_internal.py:410
↓ 1 callers
Method
_validate_value
(self, value: Any)
chex/_src/dimensions.py:234
↓ 1 callers
Method
add_variants
Merge variants.
chex/_src/variants.py:138
↓ 1 callers
Function
assert_scalar_non_negative
Checks that a scalar is non-negative. Args: x: A value to check. Raises: AssertionError: If ``x`` is not a scalar or negative.
chex/_src/asserts.py:341
↓ 1 callers
Function
assert_trees_all_equal_dtypes
Checks that trees' leaves have the same dtype. Args: *trees: A sequence of (at least 2) trees to check. Raises: AssertionError: If leave
chex/_src/asserts.py:1447
↓ 1 callers
Function
assert_trees_all_equal_shapes
Checks that trees have the same structure and leaves' shapes. Args: *trees: A sequence of (at least 2) trees with array leaves. Raises:
chex/_src/asserts.py:1486
↓ 1 callers
Function
assert_trees_all_equal_structs
Checks that trees have the same structure. Args: *trees: A sequence of (at least 2) trees to assert equal structure between. Raises: Val
chex/_src/asserts.py:1374
↓ 1 callers
Function
block_until_chexify_assertions_complete
Waits until all asynchronous checks complete. See `chexify` for more detail.
chex/_src/asserts_chexify.py:65
↓ 1 callers
Function
chexify
Wraps a transformed function `fn` to enable Chex value assertions. Chex value/runtime assertions access concrete values of tensors (e.g. `assert_
chex/_src/asserts_chexify.py:89
↓ 1 callers
Function
cmp_fn
(arr_1, arr_2)
chex/_src/asserts.py:1456
↓ 1 callers
Function
convert_jax_path_to_dm_path
Converts a path from jax.tree_util to one from dm-tree.
chex/_src/asserts_internal.py:459
↓ 1 callers
Function
convert_to_varargs
Converts varargs+kwargs function arguments into varargs only.
chex/_src/fake.py:85
↓ 1 callers
Function
count_num_calls
Counts the number of times the function was called.
chex/_src/variants.py:112
↓ 1 callers
Function
fake_jit
Context manager for patching `jax.jit` with the identity function. This is intended to be used as a debugging tool to programmatically enable or
chex/_src/fake.py:219
↓ 1 callers
Function
fake_pmap
Context manager for patching `jax.pmap` with `jax.vmap`. This is intended to be used as a debugging tool to programmatically replace pmap transfo
chex/_src/fake.py:260
↓ 1 callers
Function
find_internal_python_modules
Returns `(name, module)` for all submodules under `root_module`.
docs/ext/coverage_check.py:27
↓ 1 callers
Function
format_tree_path
(path: Sequence[Any])
chex/_src/asserts_internal.py:298
↓ 1 callers
Function
g0
(a, b, c)
chex/_src/warnings_test.py:29
↓ 1 callers
Function
g1
(a, b, c)
chex/_src/warnings_test.py:34
↓ 1 callers
Function
generate
()
chex/_src/variants.py:99
↓ 1 callers
Method
generate_test_class
Returns a test class derived from the specified bases.
chex/_src/variants_test.py:330
↓ 1 callers
Function
get_chexify_err_message
Constructs an error message for the chexify exception.
chex/_src/asserts_internal.py:134
↓ 1 callers
Function
get_n_cpu_devices_from_xla_flags
Parses number of CPUs from the XLA environment flags.
chex/_src/fake.py:45
↓ 1 callers
Function
get_public_symbols
()
docs/ext/coverage_check.py:49
↓ 1 callers
Function
get_stacktrace_without_chex_internals
Returns the latest non-chex frame from the call stack.
chex/_src/asserts_internal.py:104
↓ 1 callers
Function
has_tracers
Checks whether a tree contains any tracers.
chex/_src/asserts_internal.py:324
↓ 1 callers
Function
is_allowed
(backend_platform)
chex/_src/restrict_backends.py:94
↓ 1 callers
Function
reduce_fn
(x)
chex/_src/variants.py:501
Method
_
(*unused_args)
chex/_src/variants_test.py:391
Method
__call__
(self, *unused_args, **unused_kwargs)
chex/_src/fake_test.py:439
Method
__call__
(self)
chex/_src/variants.py:151
Method
__call__
(self, *args, **kwargs)
chex/_src/variants.py:623
Method
__call__
Forwards class to dataclasses's wrapper and registers it with JAX.
chex/_src/dataclass.py:169
next →
1–100 of 578, ranked by callers