MCPcopy Create free account

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

Functions1,092 in github.com/google-deepmind/penzai

Methodinput_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:159
Methodinput_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:217
Methodinput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:240
Methodinput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:385
Methodinput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:579
Methodinput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:699
Methodinput_structure
(self)
tests/deprecated/v1/shapecheck_layer_test.py:35
Methodinput_structure
(self)
tests/deprecated/v1/data_effects/side_output_test.py:41
Methodinput_structure
(self)
tests/deprecated/v1/data_effects/local_state_test.py:63
Methodinput_structure
(self)
tests/deprecated/v1/data_effects/random_test.py:38
Methodinput_structure
(self)
tests/deprecated/v1/data_effects/side_input_test.py:38
Methodinput_structure
(self)
tests/treescope/fixtures/treescope_examples_fixture.py:42
Functionis_anonymous_sequential
Checks if the type of a node is exactly `Sequential`, not a subclass.
penzai/nn/grouping.py:262
Functionis_anonymous_sequential
Checks if the type of a node is exactly `Sequential`, not a subclass.
penzai/deprecated/v1/nn/grouping.py:258
Methodis_empty
Returns True if there are no variables.
penzai/core/shapecheck.py:1099
Functionis_rendering_a_selection
Returns whether we are currently rendering a selection.
penzai/core/_treescope_handlers/selection_rendering.py:68
Methodkey_for_field
Returns a custom GetAttrKey with layer stack metadata.
penzai/nn/layer_stack.py:258
Methodkey_for_field
(self, field_name: str)
tests/core/struct_pytree_dataclass_test.py:406
Methodkv_cache_initializer
()
penzai/deprecated/v1/nn/attention.py:269
Functionlayerstack_axes_from_keypath
Extracts the stacked axes from a keypath. This can be used to initialize new variables for transformations that modify layers inside a LayerStack
penzai/nn/layer_stack.py:374
Functionlinkcode_resolve
Resolve a GitHub URL corresponding to Python object.
docs/conf.py:239
Functionllama_from_huggingface_model
Converts a HuggingFace Llama model to a Penzai model. This function converts Llama models from their HuggingFace implementations to Penzai. (Othe
penzai/models/transformer/variants/llama.py:28
Functionllamalike_from_huggingface_model
Converts a "llama-like" HuggingFace model to a Penzai model. This function converts Llama-like models from their HuggingFace implementations to P
penzai/models/transformer/variants/llamalike_common.py:543
Functionloraify_linears_in_selection
Replaces Linear layers inside a selected part of a model with LoRA blocks. This function should usually be called after freezing the existing weigh
penzai/toolshed/lora.py:94
Functionloraify_linears_in_selection
Replaces Linear layers inside a selected part of a model with LoRA blocks. This function should usually be called after freezing the existing weigh
penzai/deprecated/v1/toolshed/lora.py:93
Methodloss_fn
(model, rng, state)
tests/toolshed/lora_test.py:77
Methodloss_fn
(model, rng, state, xor_inputs, xor_labels)
tests/models/simple_mlp_test.py:73
Methodloss_fn
(model, rng, state)
tests/deprecated/v1/example_models/simple_mlp_test.py:57
Methodloss_fn
(model, rng, state)
tests/deprecated/v1/toolshed/lora_test.py:73
Functionmake_and_inline_shape_annotation
( keypath, marker: _InterceptValues )
penzai/deprecated/v1/toolshed/interleave_intermediates.py:165
Functionmake_and_inline_shape_annotation
( keypath, marker: _InterceptShapes )
penzai/deprecated/v1/toolshed/annotate_shapes.py:147
Functionmake_capturer
(target)
penzai/deprecated/v1/toolshed/isolate_submodel.py:123
Functionmake_parameter
Makes a parameter variable (or slot) with a given name and initializer. Args: name: The name of the parameter. init_base_rng: The base PRNG
penzai/nn/parameters.py:80
Functionmark_shareable
Marks all uninitialized parameters in ``submodel`` as shareable. This function is used to annotate the parameters in part of a model as being sha
penzai/deprecated/v1/nn/parameters.py:461
Methodmax
(self, values, /, **kwargs)
penzai/core/named_axes.py:682
Functionmaybe_dropout
Constructs either a stochastic or disabled dropout layer. Args: drop_rate: Probability of dropping an element. If None, dropout will be d
penzai/nn/dropout.py:133
Functionmaybe_dropout
Constructs either a stochastic or disabled dropout layer. Args: drop_rate: Probability of dropping an element. If None, dropout will be d
penzai/deprecated/v1/nn/dropout.py:135
Methodmin
(self, values, /, **kwargs)
penzai/core/named_axes.py:679
Functionmistral_from_huggingface_model
Converts a HuggingFace Mistral model to a Penzai model. This function converts Mistral models from their HuggingFace implementations to Penzai. (
penzai/models/transformer/variants/mistral.py:28
Methodmodel
The full model, including parameters and nonlearnable parts.
penzai/deprecated/v1/toolshed/basic_training.py:114
Methodmul
(self, values, /, **kwargs)
penzai/core/named_axes.py:667
Methodmultiply
(self, values, /, **kwargs)
penzai/core/named_axes.py:664
Methodmy_nmappable_function
(named_1, a_string, structure, named_2, ordinary)
tests/core/named_axes_test.py:323
Methodmy_var_fun
(thing_with_vars, increment, something_else)
tests/core/variables_test.py:288
Functionname_to_name_device_put
Shards a tree of `pz.nx.NamedArray` objects based on their axis names. Args: tree: A PyTree of NamedArrays. mesh: The Mesh to shard the tre
penzai/toolshed/sharding_util.py:122
Methodnamed_shape
A mapping of axis names to their sizes.
penzai/core/named_axes.py:702
Methodnamed_shape
(self)
penzai/core/named_axes.py:1485
Methodnamed_shape
(self)
penzai/core/named_axes.py:1625
Methodnext_key
(self)
penzai/deprecated/v1/data_effects/random.py:83
Methodnum_multi_dim_vars
(self)
penzai/core/shapecheck.py:224
Functionones
Constructs a named array of ones with a given shape. Args: named_shape: Named shape for the result. dtype: Optional dtype for the result.
penzai/core/named_axes.py:1836
Functionouter_fun
(*args, **kwargs)
penzai/core/variables.py:453
Methodoutput_axes
The axis names and sizes that will appear in the output only.
penzai/nn/linear_and_affine.py:616
Methodoutput_axes
The axis names and sizes that will appear in the output only.
penzai/deprecated/v1/nn/linear_and_affine.py:614
Methodoutput_structure
(self)
penzai/deprecated/v1/example_models/gemma/model_core.py:450
Methodoutput_structure
(self)
penzai/deprecated/v1/example_models/gemma/sampling_mode.py:233
Methodoutput_structure
(self)
penzai/deprecated/v1/data_effects/side_output.py:142
Methodoutput_structure
(self)
penzai/deprecated/v1/data_effects/local_state.py:315
Methodoutput_structure
(self)
penzai/deprecated/v1/data_effects/side_input.py:124
Methodoutput_structure
(self)
penzai/deprecated/v1/data_effects/random.py:119
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/standardization.py:72
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/standardization.py:165
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/grouping.py:214
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/dropout.py:75
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/basic_ops.py:49
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/basic_ops.py:85
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:164
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:225
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:341
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:249
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:404
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:590
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:710
Methodoutput_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:807
Methodoutput_structure
(self)
tests/deprecated/v1/shapecheck_layer_test.py:41
Methodoutput_structure
(self)
tests/deprecated/v1/data_effects/side_output_test.py:44
Methodoutput_structure
(self)
tests/deprecated/v1/data_effects/local_state_test.py:66
Methodoutput_structure
(self)
tests/deprecated/v1/data_effects/random_test.py:41
Methodoutput_structure
(self)
tests/deprecated/v1/data_effects/side_input_test.py:41
Methodoutput_structure
(self)
tests/treescope/fixtures/treescope_examples_fixture.py:45
Methodparallel_axes
The axis names and sizes that should appear in both input and output.
penzai/nn/linear_and_affine.py:625
Methodparallel_axes
The axis names and sizes that should appear in both input and output.
penzai/deprecated/v1/nn/linear_and_affine.py:623
Functionpatch_ipdb
Patches the IPython debugger to use `IPython.display.display`.
penzai/toolshed/patch_ipdb.py:47
Methodpositional_shape
A tuple of axis sizes for any anonymous axes.
penzai/core/named_axes.py:707
Methodpositional_shape
(self)
penzai/core/named_axes.py:1489
Methodpositional_shape
(self)
penzai/core/named_axes.py:1632
Methodpositional_shape
(self)
penzai/core/shapecheck.py:310
Methodpower
(self, values, /, **kwargs)
penzai/core/named_axes.py:676
Methodpredicate
(path, node)
tests/core/selectors_test.py:296
Methodpredicate
(req)
tests/deprecated/v1/data_effects/random_test.py:81
Functionpretty_keystr
Constructs a pretty name from a keypath and an object. This can be used to construct human-readable names for locations inside a PyTree. Args:
penzai/core/tree_util.py:62
Methodprocess
(subtree)
penzai/core/selectors.py:668
Methodprocess_leaf_or_filtered
Processes leaves or values where filter_fn is True.
penzai/core/selectors.py:882
Functionprocess_selected
Process PyTree leaves or subtrees where _is_hole_or_quote is True.
penzai/core/selectors.py:1475
Methodprocess_selected
Processes one of the selected subtrees.
penzai/core/selectors.py:865
Methodprocess_subselection
(subselection: Selection)
penzai/core/selectors.py:464
Methodprocess_subtree
Recursively walks subtrees one level at a time. Args: keypath: Keypath to this subtree leaf_or_subtree: The subtree
penzai/core/selectors.py:817
Functionpytree_dataclass
(*args, **kwargs)
penzai/deprecated/v1/pz/__init__.py:87
Functionpytree_dataclass
(*args, **kwargs)
penzai/pz/__init__.py:108
Functionrandom_split
Splits a PRNG key into a `NamedArray` of PRNG keys with the given names. Args: key: PRNG key to split. Can also be a NamedArray of keys with di
penzai/core/named_axes.py:1881
← previousnext →601–700 of 1,092, ranked by callers