Skip to content
class

CatTransform

extendsTransform
CatTransform(transforms: list[Transform], dim: int = 0, lengths: list[int] | None = None)

Apply different transforms to contiguous partitions along an axis.

Splits the input along dim into contiguous chunks of size lengths[i] (one element each if lengths is None), applies the ii-th transform to the ii-th chunk, and concatenates the results back along the same axis.

Parameters

transformslist[Transform]
One transform per partition.
dimint= 0
Concatenation dimension. Default 0.
lengthslist[int]= None
Length of each partition. Default None: one per transform.

Used by 1

Constructors

1
dunder

__init__

→None
__init__(transforms: list[Transform], dim: int = 0, lengths: list[int] | None = None)

Store the per-partition transforms, concat axis, and partition lengths.

Properties

2
prop

codomain

→Constraint
codomain: Constraint

Concatenated codomain constraint across all partition transforms.

prop

domain

→Constraint
domain: Constraint

Concatenated domain constraint across all partition transforms.

Instance methods

1
fn

log_abs_det_jacobian

→Tensor
log_abs_det_jacobian(x: Tensor, y: Tensor)

Per-partition Jacobians concatenated or summed according to event_dim.