From

Contents

From#

class penzai.toolshed.model_rewiring.From[source]#

Bases: object

A connection between two parallel computations.

This class identifies a source “world” and combines it with a weight value or array. This is used to indicate how to rewire connections using RewireComputationPaths.

Variables:
  • source (str) – The parallel world name this connection reads from.

  • weight (float | pz.nx.NamedArray) – The weight of this connection. Should either be a scalar float, or a pz.nx.NamedArray with a scalar positional shape. If a NamedArray, the named axes will indicate different connection behavior for each named axis (e.g. if weight has a “heads” axis, a different weight will be used for each head of the input activation).

Methods

__init__(source[, weight])

Attributes

weight

source