Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/google-deepmind/penzai
/ types & classes
Types & classes
360 in github.com/google-deepmind/penzai
⨍
Functions
1,092
◇
Types & classes
360
↳
Endpoints
3
↓ 88 callers
Class
CustomLeaf
A leaf type for use in tests.
tests/core/selectors_test.py:32
↓ 74 callers
Class
SELECTED_PART
(Visually-distinctive) marker class for the selected subtree in tests.
tests/core/selectors_test.py:51
↓ 22 callers
Class
TaggedStruct
A simple identity layer with a comment tag, for assertions.
tests/nn/grouping_test.py:25
↓ 22 callers
Class
TaggedStruct
A simple identity layer with a comment tag, for assertions.
tests/deprecated/v1/nn/grouping_test.py:25
↓ 8 callers
Class
NamedArray
r"""A multidimensional array with a combination of positional and named axes. Conceptually, ``NamedArray``\ s can have positional axes like an ordi
penzai/core/named_axes.py:1338
↓ 8 callers
Class
_InProgressSelectionBoundary
Helper object for building a selection. Not intended to be exposed to user code! If you're seeing this and you don't expect to, please file an is
penzai/core/selectors.py:127
↓ 6 callers
Class
HandledRandomRef
Reference for a handled random effect.
penzai/deprecated/v1/data_effects/random.py:68
↓ 5 callers
Class
CallMockHelper
Helper object to call a function with it's value and a child. Attributes: child: A PyTree child. Can be traversed to handle effects. fn: A
tests/deprecated/v1/nn/parameters_test.py:34
↓ 5 callers
Class
DimVar
A dimension variable, which will be matched with the shapes in a structure. In a slight abuse of syntax, ``DimVar`` can be unpacked using ``*`` or
penzai/core/shapecheck.py:74
↓ 5 callers
Class
NamedArrayView
A possibly-transposed view of an array with positional and named axes. This view identifies a particular set of axes in a data array as "virtual
penzai/core/named_axes.py:1544
↓ 5 callers
Class
TmpPosAxisMarker
A marker object used to temporarily assign names to positional axes. Every ``TmpPosAxisMarker`` is unique, comparing equal only to itself, so it is
penzai/core/named_axes.py:111
↓ 5 callers
Class
_UnsatisfiedConstraint
A constraint that we have already failed to satisfy.
penzai/core/shapecheck.py:253
↓ 4 callers
Class
Bar
tests/core/selectors_test.py:621
↓ 4 callers
Class
Foo
tests/core/selectors_test.py:616
↓ 4 callers
Class
MyLayer
tests/nn/layer_test.py:25
↓ 4 callers
Class
Selection
A selected subset of nodes within a larger PyTree. Penzai selectors (such as ``.at(...)``) return ``Selection`` objects, which indicate a specifi
penzai/core/selectors.py:164
↓ 3 callers
Class
Bar
tests/core/auto_order_types_test.py:32
↓ 3 callers
Class
Foo
tests/core/auto_order_types_test.py:27
↓ 3 callers
Class
HandledLocalStateRef
Marker for a handled local state effect. Attributes: handler_id: The ID of the handler that is responsible for handling this effect.
penzai/deprecated/v1/data_effects/local_state.py:207
↓ 3 callers
Class
IncrementEverythingLayer
tests/deprecated/v1/data_effects/local_state_test.py:79
↓ 3 callers
Class
KnownDim
A dimension with a known value, used to bind a name to a value directly. The usual way to create a ``KnownDim`` is by calling `vars_for_axes` with
penzai/core/shapecheck.py:134
↓ 3 callers
Class
MyEffectfulLayer
tests/deprecated/v1/data_effects/random_test.py:27
↓ 3 callers
Class
MyEffectfulLayer
tests/deprecated/v1/data_effects/side_input_test.py:28
↓ 3 callers
Class
MySideOutputWritingLayer
tests/deprecated/v1/data_effects/side_output_test.py:25
↓ 3 callers
Class
Parameter
A learnable parameter. Most initialized layers should use Parameter to store their learnable parameters. Attributes: value: The value of t
penzai/deprecated/v1/nn/parameters.py:159
↓ 3 callers
Class
PyTreeDataclassSafetyError
Error raised due to pytree dataclass safety checks.
penzai/core/struct.py:65
↓ 3 callers
Class
RandomEffectImpl
Implementation of the random number generation effect.
penzai/deprecated/v1/data_effects/random.py:77
↓ 3 callers
Class
SELECTED_LEVEL_3
tests/core/selectors_test.py:1120
↓ 3 callers
Class
SomeStruct
tests/core/struct_pytree_dataclass_test.py:116
↓ 3 callers
Class
StructureMismatchError
Raised when a `check_structure` call fails.
penzai/core/shapecheck.py:499
↓ 3 callers
Class
WeirdModel
tests/toolshed/unflaxify_test.py:88
↓ 3 callers
Class
WeirdModel
tests/deprecated/v1/toolshed/unflaxify_test.py:90
↓ 3 callers
Class
_Binding
A binding for a variable set by a keypath.
penzai/core/shapecheck.py:504
↓ 2 callers
Class
ArraySpec
A non-leaf marker for a (named) array structure. This is like a `jax.ShapeDtypeStruct`, but it is an empty PyTree node instead of being a leaf, s
penzai/core/shapecheck.py:265
↓ 2 callers
Class
AttentionTypeGlobalCausal
Marker for a global attention block.
penzai/models/transformer/variants/llamalike_common.py:45
↓ 2 callers
Class
AutoNmapModuleWrapper
Wrapper for a module that automatically applies `nmap` to callables. Attributes: _module: The module to wrap.
penzai/toolshed/auto_nmap.py:62
↓ 2 callers
Class
DisabledDropout
A no-op layer taking the place of a disabled `StochasticDropout` layer. This layer can be used to mark a location in a model where dropout could
penzai/nn/dropout.py:99
↓ 2 callers
Class
DisabledDropout
A no-op layer taking the place of a disabled `StochasticDropout` layer. This layer can be used to mark a location in a model where dropout could
penzai/deprecated/v1/nn/dropout.py:107
↓ 2 callers
Class
FrozenLocalStateRequest
Effect request for local state with a frozen value. This can be used to store the state for a stateful model after it has been initialized and po
penzai/deprecated/v1/data_effects/local_state.py:138
↓ 2 callers
Class
GemmaKVCachingState
Sampling state for the key-value-caching Gemma variant. You should not usually need to construct this on your own. Instead, it will be returned b
penzai/deprecated/v1/example_models/gemma/sampling_mode.py:83
↓ 2 callers
Class
HandledSideInputRef
Reference for a handled side input effect.
penzai/deprecated/v1/data_effects/side_input.py:68
↓ 2 callers
Class
InterceptedFlaxScopeData
A frozen representation of data in a particular Flax scope. Flax implements its modules using a "functional core" which is a stateful manager of
penzai/toolshed/unflaxify.py:55
↓ 2 callers
Class
InterceptedFlaxScopeData
A frozen representation of data in a particular Flax scope. Flax implements its modules using a "functional core" which is a stateful manager of
penzai/deprecated/v1/toolshed/unflaxify.py:55
↓ 2 callers
Class
InternalTrainerState
Internal state for the trainer. Attributes: step: Current step of training. opt_state: An optimizer state for the learnable parts of `model
penzai/toolshed/basic_training.py:67
↓ 2 callers
Class
MultiDimVar
A variable standing in for a sequence or dictionary axis names. The usual way to create a ``MultiDimVar`` is by unpacking the `var` function, e.g
penzai/core/shapecheck.py:118
↓ 2 callers
Class
MyLayer
tests/deprecated/v1/shapecheck_layer_test.py:29
↓ 2 callers
Class
MySequentialSubclass
tests/nn/grouping_test.py:53
↓ 2 callers
Class
MySequentialSubclass
tests/deprecated/v1/nn/grouping_test.py:53
↓ 2 callers
Class
MyTestLayer
tests/nn/layer_stack_test.py:26
↓ 2 callers
Class
OptedInSubStruct
tests/core/struct_pytree_dataclass_test.py:162
↓ 2 callers
Class
ParameterSlot
A slot for a parameter in a model. A ParameterSlot identifies a place in a model (or other pytree) where a Penzai parameter should be substituted
penzai/core/variables.py:632
↓ 2 callers
Class
RemainingAxisPlaceholder
Sentinel marker for the remainder of axes.
penzai/core/shapecheck.py:67
↓ 2 callers
Class
SELECTED_LEVEL_1
tests/core/selectors_test.py:1112
↓ 2 callers
Class
SamplingState
State that manages the set decoded tokens during sampling. The purpose of this class is to keep the outputs, inputs, and key-value caches of the
penzai/deprecated/v1/example_models/gemma/simple_decoding_loop.py:30
↓ 2 callers
Class
SelectionBoundaryLayoutMark
A layout mark that can be used to identify selected nodes.
penzai/core/_treescope_handlers/selection_rendering.py:74
↓ 2 callers
Class
SharedLocalStateRequest
Effect request for local state that is shared. A ``SharedLocalStateRequest`` can be used to share an explicitly-named state variable between mult
penzai/deprecated/v1/data_effects/local_state.py:177
↓ 2 callers
Class
SideInputEffectImpl
Implementation of the side input effect.
penzai/deprecated/v1/data_effects/side_input.py:79
↓ 2 callers
Class
SideOutputRequest
Effect request for a side output. Since side outputs do not change the behavior of the model, ``SideOutputRequest`` implements `tell` (but in a w
penzai/deprecated/v1/data_effects/side_output.py:48
↓ 2 callers
Class
StateVariableSlot
A slot for a parameter in a model. A StateVariableSlot identifies a place in a model (or other pytree) where a Penzai state variable should be su
penzai/core/variables.py:786
↓ 2 callers
Class
StochasticDropout
Stochastic dropout layer. Dropout layers randomly mask out elements with a probability ``drop_rate``, and then scale the output up by a factor of
penzai/nn/dropout.py:30
↓ 2 callers
Class
StochasticDropout
Stochastic dropout layer. Dropout layers randomly mask out elements with a probability ``drop_rate``, and then scale the output up by a factor of
penzai/deprecated/v1/nn/dropout.py:32
↓ 2 callers
Class
StochasticModel
tests/toolshed/unflaxify_test.py:153
↓ 2 callers
Class
StructStaticMetadata
Container for a struct's static fields. Attributes: child_field_names: Names of all non-static fields in PyTree serialization order.
penzai/core/struct.py:441
↓ 2 callers
Class
UnboundVariableError
Raised when attempting to access the value of an unbound variable.
penzai/core/variables.py:95
↓ 2 callers
Class
UnhandledEffectError
Exception raised when a method is called on an unhandled effect.
penzai/deprecated/v1/data_effects/effect_base.py:91
↓ 2 callers
Class
VariableConflictError
Raised when a Variable label is used by multiple Variables.
penzai/core/variables.py:91
↓ 2 callers
Class
WeirdDense
tests/toolshed/unflaxify_test.py:51
↓ 2 callers
Class
WeirdDense
tests/deprecated/v1/toolshed/unflaxify_test.py:52
↓ 2 callers
Class
_DynamicThunk
penzai/core/named_axes.py:401
↓ 2 callers
Class
_NamedConstraint
A constraint for matching two named shapes.
penzai/core/shapecheck.py:229
↓ 2 callers
Class
_PositionalConstraint
A constraint for matching two positional shapes.
penzai/core/shapecheck.py:211
↓ 2 callers
Class
_SliceThunk
penzai/core/named_axes.py:409
↓ 2 callers
Class
_StaticThunk
penzai/core/named_axes.py:393
↓ 1 callers
Class
ApplyRoPE
Adjusts input embeddings using rotary position embeddings (RoPE). Rotary position embeddings, proposed by Su et al. (2021), incorporate relative
penzai/nn/embeddings.py:206
↓ 1 callers
Class
ArgsAndKwargs
Representation of the arguments and kwargs of a function call.
penzai/toolshed/unflaxify.py:42
↓ 1 callers
Class
ArgsAndKwargs
Representation of the arguments and kwargs of a function call.
penzai/deprecated/v1/toolshed/unflaxify.py:42
↓ 1 callers
Class
AttentionTypeSlidingWindowCausal
Marker for a local sliding-window attention block. Attributes: window_size: Size of the sliding window.
penzai/models/transformer/variants/llamalike_common.py:50
↓ 1 callers
Class
AutoStateVarLabel
A label for a StateVariable that is unique based on Python object ID.
penzai/core/variables.py:659
↓ 1 callers
Class
CalledWithManyStructures
No-op annotation that indicates values of many different shapes.
penzai/deprecated/v1/toolshed/annotate_shapes.py:52
↓ 1 callers
Class
CustomInitSubclassManual
tests/core/struct_pytree_dataclass_test.py:313
↓ 1 callers
Class
CustomInitSubclassOptIn
tests/core/struct_pytree_dataclass_test.py:291
↓ 1 callers
Class
CustomInitSubclassOptOut
tests/core/struct_pytree_dataclass_test.py:302
↓ 1 callers
Class
DimensionVariableSubstitution
A substitution for all of the dimension variables in a structure. DimensionVariableSubstitution can be used to inspect and modify the dimension v
penzai/core/shapecheck.py:1073
↓ 1 callers
Class
FlaxVarLabel
A StateVariable label for a Flax variable.
penzai/toolshed/unflaxify.py:84
↓ 1 callers
Class
GPTNeoXTransformerConfig
Configuration parameters for a GPT Neo-X transformer. These are held in a single configuration object to simplify argument passing during constru
penzai/models/transformer/variants/gpt_neox.py:42
↓ 1 callers
Class
GemmaInputs
Input structure for `GemmaTransformer`. Attributes: tokens: Sequence of tokens, as an integer named array with a "seq" axis and possibly
penzai/deprecated/v1/example_models/gemma/model_core.py:360
↓ 1 callers
Class
GemmaKVCachingInputs
Input structure for the `GemmaKVCachingTransformer`. Attributes: tokens: Subsequence of the current tokens we are processing, as an integer
penzai/deprecated/v1/example_models/gemma/sampling_mode.py:107
↓ 1 callers
Class
GemmaTransformer
Top-level Gemma transformer decoder, encapsulating all internal effects. This class represents the full Gemma model, and can be loaded from the o
penzai/deprecated/v1/example_models/gemma/model_core.py:409
↓ 1 callers
Class
GemmaTransformerConfig
Common configuration parameters for the Gemma transformer architecture. These are held in a single configuration object to simplify argument passin
penzai/deprecated/v1/example_models/gemma/model_core.py:82
↓ 1 callers
Class
HandledSideOutputRef
Marker for a handled local state effect. Attributes: handler_id: The ID of the handler that is responsible for handling this effect.
penzai/deprecated/v1/data_effects/side_output.py:70
↓ 1 callers
Class
IdentityWithExtraPayload
tests/deprecated/v1/data_effects/local_state_test.py:74
↓ 1 callers
Class
IdentityWithExtraPayload
tests/deprecated/v1/data_effects/random_test.py:49
↓ 1 callers
Class
IdentityWithSavedActivations
No-op annotation that holds onto intermediate activations.
penzai/deprecated/v1/toolshed/interleave_intermediates.py:56
↓ 1 callers
Class
IgnoreBangWarningFilter
docs/conf.py:76
↓ 1 callers
Class
InterceptedFlaxModuleMethod
A representation of an intercepted Flax module method call. An InterceptedFlaxModule captures the logic that runs when you call a single Flax mod
penzai/toolshed/unflaxify.py:92
↓ 1 callers
Class
InterceptedFlaxModuleMethod
A representation of an intercepted Flax module method call. An InterceptedFlaxModule captures the logic that runs when you call a single Flax mod
penzai/deprecated/v1/toolshed/unflaxify.py:84
↓ 1 callers
Class
IsolatedSubmodel
An isolated part of a model, with saved inputs, outputs, and variables. Variable values will also be frozen at the state they had when the model
penzai/toolshed/isolate_submodel.py:35
↓ 1 callers
Class
IsolatedSubmodel
An isolated part of a submodel, with its saved inputs and outputs. When initially populated by `isolate_submodel`, any states used by the submode
penzai/deprecated/v1/toolshed/isolate_submodel.py:36
↓ 1 callers
Class
IsolationCapturer
Helper object that captures information while running the submodel.
penzai/toolshed/isolate_submodel.py:76
↓ 1 callers
Class
IsolationCapturer
Helper object that captures information necessary to isolate the submodel.
penzai/deprecated/v1/toolshed/isolate_submodel.py:57
next →
1–100 of 360, ranked by callers