Docs / jax4j-core / com.nablatensor.jax4j.tensor

final class

ControlFlow

Fixed-shape structured regions. Predicates are scalar F32 tensors: zero is false.

Methods

static Tensor cond(Tensor predicate, UnaryOperator<Tensor> onTrue, UnaryOperator<Tensor> onFalse, Tensor operand)
static Tensor whileLoop(UnaryOperator<Tensor> predicate, UnaryOperator<Tensor> body, Tensor initial)
static ScanResult scan(BiFunction<Tensor, Tensor, ScanStep> body, Tensor initial, Tensor xs)

Scan's body is captured once; the iteration dimension remains a device loop.

static P condTree(Tensor predicate, UnaryOperator<P> yes, UnaryOperator<P> no, P operand)
static P whileTree(Function<P, Tensor> predicate, UnaryOperator<P> body, P initial)
static TreeScanResult<C, Y> scanTree(BiFunction<C, X, TreeScanStep<C, Y>> body, C initial, X xs)