Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/google-deepmind/penzai
/ functions
Functions
1,092 in github.com/google-deepmind/penzai
⨍
Functions
1,092
◇
Types & classes
360
↳
Endpoints
3
Method
input_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:159
Method
input_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:217
Method
input_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:240
Method
input_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:385
Method
input_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:579
Method
input_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:699
Method
input_structure
(self)
tests/deprecated/v1/shapecheck_layer_test.py:35
Method
input_structure
(self)
tests/deprecated/v1/data_effects/side_output_test.py:41
Method
input_structure
(self)
tests/deprecated/v1/data_effects/local_state_test.py:63
Method
input_structure
(self)
tests/deprecated/v1/data_effects/random_test.py:38
Method
input_structure
(self)
tests/deprecated/v1/data_effects/side_input_test.py:38
Method
input_structure
(self)
tests/treescope/fixtures/treescope_examples_fixture.py:42
Function
is_anonymous_sequential
Checks if the type of a node is exactly `Sequential`, not a subclass.
penzai/nn/grouping.py:262
Function
is_anonymous_sequential
Checks if the type of a node is exactly `Sequential`, not a subclass.
penzai/deprecated/v1/nn/grouping.py:258
Method
is_empty
Returns True if there are no variables.
penzai/core/shapecheck.py:1099
Function
is_rendering_a_selection
Returns whether we are currently rendering a selection.
penzai/core/_treescope_handlers/selection_rendering.py:68
Method
key_for_field
Returns a custom GetAttrKey with layer stack metadata.
penzai/nn/layer_stack.py:258
Method
key_for_field
(self, field_name: str)
tests/core/struct_pytree_dataclass_test.py:406
Method
kv_cache_initializer
()
penzai/deprecated/v1/nn/attention.py:269
Function
layerstack_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
Function
linkcode_resolve
Resolve a GitHub URL corresponding to Python object.
docs/conf.py:239
Function
llama_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
Function
llamalike_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
Function
loraify_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
Function
loraify_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
Method
loss_fn
(model, rng, state)
tests/toolshed/lora_test.py:77
Method
loss_fn
(model, rng, state, xor_inputs, xor_labels)
tests/models/simple_mlp_test.py:73
Method
loss_fn
(model, rng, state)
tests/deprecated/v1/example_models/simple_mlp_test.py:57
Method
loss_fn
(model, rng, state)
tests/deprecated/v1/toolshed/lora_test.py:73
Function
make_and_inline_shape_annotation
( keypath, marker: _InterceptValues )
penzai/deprecated/v1/toolshed/interleave_intermediates.py:165
Function
make_and_inline_shape_annotation
( keypath, marker: _InterceptShapes )
penzai/deprecated/v1/toolshed/annotate_shapes.py:147
Function
make_capturer
(target)
penzai/deprecated/v1/toolshed/isolate_submodel.py:123
Function
make_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
Function
mark_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
Method
max
(self, values, /, **kwargs)
penzai/core/named_axes.py:682
Function
maybe_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
Function
maybe_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
Method
min
(self, values, /, **kwargs)
penzai/core/named_axes.py:679
Function
mistral_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
Method
model
The full model, including parameters and nonlearnable parts.
penzai/deprecated/v1/toolshed/basic_training.py:114
Method
mul
(self, values, /, **kwargs)
penzai/core/named_axes.py:667
Method
multiply
(self, values, /, **kwargs)
penzai/core/named_axes.py:664
Method
my_nmappable_function
(named_1, a_string, structure, named_2, ordinary)
tests/core/named_axes_test.py:323
Method
my_var_fun
(thing_with_vars, increment, something_else)
tests/core/variables_test.py:288
Function
name_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
Method
named_shape
A mapping of axis names to their sizes.
penzai/core/named_axes.py:702
Method
named_shape
(self)
penzai/core/named_axes.py:1485
Method
named_shape
(self)
penzai/core/named_axes.py:1625
Method
next_key
(self)
penzai/deprecated/v1/data_effects/random.py:83
Method
num_multi_dim_vars
(self)
penzai/core/shapecheck.py:224
Function
ones
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
Function
outer_fun
(*args, **kwargs)
penzai/core/variables.py:453
Method
output_axes
The axis names and sizes that will appear in the output only.
penzai/nn/linear_and_affine.py:616
Method
output_axes
The axis names and sizes that will appear in the output only.
penzai/deprecated/v1/nn/linear_and_affine.py:614
Method
output_structure
(self)
penzai/deprecated/v1/example_models/gemma/model_core.py:450
Method
output_structure
(self)
penzai/deprecated/v1/example_models/gemma/sampling_mode.py:233
Method
output_structure
(self)
penzai/deprecated/v1/data_effects/side_output.py:142
Method
output_structure
(self)
penzai/deprecated/v1/data_effects/local_state.py:315
Method
output_structure
(self)
penzai/deprecated/v1/data_effects/side_input.py:124
Method
output_structure
(self)
penzai/deprecated/v1/data_effects/random.py:119
Method
output_structure
(self)
penzai/deprecated/v1/nn/standardization.py:72
Method
output_structure
(self)
penzai/deprecated/v1/nn/standardization.py:165
Method
output_structure
(self)
penzai/deprecated/v1/nn/grouping.py:214
Method
output_structure
(self)
penzai/deprecated/v1/nn/dropout.py:75
Method
output_structure
(self)
penzai/deprecated/v1/nn/basic_ops.py:49
Method
output_structure
(self)
penzai/deprecated/v1/nn/basic_ops.py:85
Method
output_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:164
Method
output_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:225
Method
output_structure
(self)
penzai/deprecated/v1/nn/embeddings.py:341
Method
output_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:249
Method
output_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:404
Method
output_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:590
Method
output_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:710
Method
output_structure
(self)
penzai/deprecated/v1/nn/linear_and_affine.py:807
Method
output_structure
(self)
tests/deprecated/v1/shapecheck_layer_test.py:41
Method
output_structure
(self)
tests/deprecated/v1/data_effects/side_output_test.py:44
Method
output_structure
(self)
tests/deprecated/v1/data_effects/local_state_test.py:66
Method
output_structure
(self)
tests/deprecated/v1/data_effects/random_test.py:41
Method
output_structure
(self)
tests/deprecated/v1/data_effects/side_input_test.py:41
Method
output_structure
(self)
tests/treescope/fixtures/treescope_examples_fixture.py:45
Method
parallel_axes
The axis names and sizes that should appear in both input and output.
penzai/nn/linear_and_affine.py:625
Method
parallel_axes
The axis names and sizes that should appear in both input and output.
penzai/deprecated/v1/nn/linear_and_affine.py:623
Function
patch_ipdb
Patches the IPython debugger to use `IPython.display.display`.
penzai/toolshed/patch_ipdb.py:47
Method
positional_shape
A tuple of axis sizes for any anonymous axes.
penzai/core/named_axes.py:707
Method
positional_shape
(self)
penzai/core/named_axes.py:1489
Method
positional_shape
(self)
penzai/core/named_axes.py:1632
Method
positional_shape
(self)
penzai/core/shapecheck.py:310
Method
power
(self, values, /, **kwargs)
penzai/core/named_axes.py:676
Method
predicate
(path, node)
tests/core/selectors_test.py:296
Method
predicate
(req)
tests/deprecated/v1/data_effects/random_test.py:81
Function
pretty_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
Method
process
(subtree)
penzai/core/selectors.py:668
Method
process_leaf_or_filtered
Processes leaves or values where filter_fn is True.
penzai/core/selectors.py:882
Function
process_selected
Process PyTree leaves or subtrees where _is_hole_or_quote is True.
penzai/core/selectors.py:1475
Method
process_selected
Processes one of the selected subtrees.
penzai/core/selectors.py:865
Method
process_subselection
(subselection: Selection)
penzai/core/selectors.py:464
Method
process_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
Function
pytree_dataclass
(*args, **kwargs)
penzai/deprecated/v1/pz/__init__.py:87
Function
pytree_dataclass
(*args, **kwargs)
penzai/pz/__init__.py:108
Function
random_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
← previous
next →
601–700 of 1,092, ranked by callers