MCPcopy Create free account

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

Functions578 in github.com/google-deepmind/chex

↓ 29 callersMethodvariant
Raises a RuntimeError if not overriden or redefined.
chex/_src/variants.py:58
↓ 18 callersFunctionas_arrays
(arrays)
chex/_src/asserts_test.py:35
↓ 13 callersFunctionassert_fn
(arr_1, arr_2)
chex/_src/asserts.py:1573
↓ 12 callersFunctioncompute_cube
(side)
chex/_src/restrict_backends_test.py:23
↓ 12 callersFunctiondummy_dataclass
(factor=1., frozen=False)
chex/_src/dataclass_test.py:80
↓ 10 callersMethod_init_testdata
Initializes test data.
chex/_src/dataclass_test.py:155
↓ 9 callersFunction_scalar_to_ndarray
(x, shape=None)
chex/_src/variants_test.py:58
↓ 8 callersFunction_device_put_replicated
(x, devices)
chex/_src/asserts_test.py:47
↓ 8 callersFunctionexec_with_tracing_counter_checks
(self, var_fn, arg_0, arg_1)
chex/_src/variants_test.py:94
↓ 7 callersFunction_assert_fn
(path, leaf)
chex/_src/asserts.py:1045
↓ 7 callersFunction_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 callersFunction_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 callersFunctionassert_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 callersFunction_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 callersFunction_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 callersFunctionassert_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 callersFunctiondcls
(cls)
chex/_src/dataclass.py:135
↓ 5 callersMethodrun_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 callersMethodstart
(self)
chex/_src/fake.py:209
↓ 4 callersMethod_assert_tree_structs_validation
Checks that assert_fn correctly processes invalid args' structs.
chex/_src/asserts_test.py:862
↓ 4 callersMethod_test_fn
(self, fn, init_args, seed, n=10)
chex/_src/asserts_test.py:1797
↓ 4 callersFunctionassert_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 callersFunctionget_chexify_err_regex
(name, msg)
chex/_src/asserts_chexify_test.py:52
↓ 4 callersFunctionrank_array
(n)
chex/_src/asserts_test.py:551
↓ 4 callersMethodstop
(self)
chex/_src/fake.py:212
↓ 3 callersFunction_check_error
Checks the error and converts it to chex format.
chex/_src/asserts_chexify.py:49
↓ 3 callersFunction_check_sharding
(x)
chex/_src/asserts.py:1061
↓ 3 callersFunction_dataclass_instance_fields
Serialization-friendly version of dataclasses.fields for instances.
chex/_src/dataclass_test.py:89
↓ 3 callersMethod_device_count
(self, backend)
chex/_src/asserts_test.py:1731
↓ 3 callersFunction_unelided_shape_matches
Returns True if `actual_shape` is compatible with `expected_shape`.
chex/_src/asserts.py:540
↓ 3 callersMethod_validate_key
(self, key: Any)
chex/_src/dimensions.py:230
↓ 3 callersFunctionassert_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 callersFunctionf
(a, b, c)
chex/_src/warnings_test.py:24
↓ 3 callersFunctioninner_fn
(*args, **kwargs)
chex/_src/asserts_internal.py:95
↓ 3 callersFunctionmappable_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 callersFunctionregister_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 callersMethodsize
Returns the flat size of a given named shape, i.e. prod(shape).
chex/_src/dimensions.py:137
↓ 2 callersFunction_restrict_by_attr_name
Patch the given backend restriction onto getattr(compiler, name).
chex/_src/restrict_backends.py:42
↓ 2 callersMethod_setdim
(self, dim: str, size: Optional[int])
chex/_src/dimensions.py:215
↓ 2 callersFunction_shape_matches
Returns True if `actual_shape` is compatible with `expected_shape`.
chex/_src/asserts.py:557
↓ 2 callersMethod_validate_dim
(self, dim: Any)
chex/_src/dimensions.py:240
↓ 2 callersFunction_variants_fn
Implements `variants` and `all_variants`.
chex/_src/variants.py:238
↓ 2 callersFunctionarray_from_shape
(*shape)
chex/_src/asserts_test.py:39
↓ 2 callersFunctionextract_relevant_dims
(shape, dims)
chex/_src/asserts.py:474
↓ 2 callersMethodsetUp
(self)
chex/_src/variants_test.py:259
↓ 2 callersFunctionwrapped_fn
(*args, **kwargs)
chex/_src/fake.py:147
↓ 2 callersMethodwrite
(self, *ignored: Any)
docs/ext/coverage_check.py:65
↓ 1 callersMethod__enter__
(self)
chex/_src/fake.py:404
↓ 1 callersMethod__exit__
(self, *unused_args)
chex/_src/fake.py:422
↓ 1 callersMethod__post_init__
(self, k_init_only)
chex/_src/dataclass_test.py:137
↓ 1 callersFunction_add_annotations_import
Appends a future annotations import to the file at the given path.
docs/conf.py:34
↓ 1 callersMethod_asdict
(self)
chex/_src/dimensions.py:201
↓ 1 callersFunction_bfloat16_nulp_diff
Number of representable bf16 points between each item in x and y.
chex/_src/asserts.py:1725
↓ 1 callersFunction_cmp_leaves
(path, *leaves)
chex/_src/asserts_internal.py:420
↓ 1 callersFunction_convert_key_fn
(key: JaxKeyType)
chex/_src/asserts_internal.py:465
↓ 1 callersMethod_deldim
(self, dim: str)
chex/_src/dimensions.py:221
↓ 1 callersFunction_device_put_replicated
(x, devices)
chex/_src/asserts_chexify_test.py:40
↓ 1 callersFunction_get_mappable_dataclasses
Generates shallow and nested mappable dataclasses.
chex/_src/dataclass_test.py:107
↓ 1 callersMethod_getdim
(self, dim: str)
chex/_src/dimensions.py:205
↓ 1 callersMethod_init
Initializes common test cases.
chex/_src/asserts_test.py:86
↓ 1 callersMethod_inner_iter
Generate chex variants for a single test.
chex/_src/variants.py:179
↓ 1 callersFunction_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 callersFunction_optional_int
(x: Any)
chex/_src/dimensions.py:250
↓ 1 callersFunction_recursive_add_annotations_import
()
docs/conf.py:54
↓ 1 callersMethod_set_test_name
Set a name for the generated test.
chex/_src/variants.py:157
↓ 1 callersFunction_test_fn_with_device
(arg_0, arg_1)
chex/_src/variants_test.py:680
↓ 1 callersFunction_test_fn_without_device
(arg_0, arg_1)
chex/_src/variants_test.py:658
↓ 1 callersFunction_tree_error_msg_fn
( path: Tuple[Union[int, str, Hashable]], i_1: int, i_2: int)
chex/_src/asserts_internal.py:410
↓ 1 callersMethod_validate_value
(self, value: Any)
chex/_src/dimensions.py:234
↓ 1 callersMethodadd_variants
Merge variants.
chex/_src/variants.py:138
↓ 1 callersFunctionassert_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 callersFunctionassert_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 callersFunctionassert_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 callersFunctionassert_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 callersFunctionblock_until_chexify_assertions_complete
Waits until all asynchronous checks complete. See `chexify` for more detail.
chex/_src/asserts_chexify.py:65
↓ 1 callersFunctionchexify
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 callersFunctioncmp_fn
(arr_1, arr_2)
chex/_src/asserts.py:1456
↓ 1 callersFunctionconvert_jax_path_to_dm_path
Converts a path from jax.tree_util to one from dm-tree.
chex/_src/asserts_internal.py:459
↓ 1 callersFunctionconvert_to_varargs
Converts varargs+kwargs function arguments into varargs only.
chex/_src/fake.py:85
↓ 1 callersFunctioncount_num_calls
Counts the number of times the function was called.
chex/_src/variants.py:112
↓ 1 callersFunctionfake_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 callersFunctionfake_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 callersFunctionfind_internal_python_modules
Returns `(name, module)` for all submodules under `root_module`.
docs/ext/coverage_check.py:27
↓ 1 callersFunctionformat_tree_path
(path: Sequence[Any])
chex/_src/asserts_internal.py:298
↓ 1 callersFunctiong0
(a, b, c)
chex/_src/warnings_test.py:29
↓ 1 callersFunctiong1
(a, b, c)
chex/_src/warnings_test.py:34
↓ 1 callersFunctiongenerate
()
chex/_src/variants.py:99
↓ 1 callersMethodgenerate_test_class
Returns a test class derived from the specified bases.
chex/_src/variants_test.py:330
↓ 1 callersFunctionget_chexify_err_message
Constructs an error message for the chexify exception.
chex/_src/asserts_internal.py:134
↓ 1 callersFunctionget_n_cpu_devices_from_xla_flags
Parses number of CPUs from the XLA environment flags.
chex/_src/fake.py:45
↓ 1 callersFunctionget_public_symbols
()
docs/ext/coverage_check.py:49
↓ 1 callersFunctionget_stacktrace_without_chex_internals
Returns the latest non-chex frame from the call stack.
chex/_src/asserts_internal.py:104
↓ 1 callersFunctionhas_tracers
Checks whether a tree contains any tracers.
chex/_src/asserts_internal.py:324
↓ 1 callersFunctionis_allowed
(backend_platform)
chex/_src/restrict_backends.py:94
↓ 1 callersFunctionreduce_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