Trait Types

Traits are very useful for reasoning about a vertex without having to look at the wrapped computation.

Imported to namespace by

using NaiveNASlib.Extend
NaiveNASlib.Immutable — Type
Immutable

Trait for vertices which are immutable. Typically inputs and outputs as those are fixed to the surroundings (e.g a data set).

source
NaiveNASlib.SizeAbsorb — Type
SizeAbsorb

Size trait type for which size changes are absorbed, i.e they do not propagate forward.

Note that size changes do propagate backward as changing the input size of a vertex requires that the output size of its input is also changed and vice versa.

source
NaiveNASlib.SizeTransparent — Type
SizeTransparent

Base type for mutation traits which are transparent w.r.t size, i.e size changes propagate both forwards and backwards.

Tip: Use with FixedSizeTrait if the function has parameters which must be aligned with the input and output sizes.

source
NaiveNASlib.SizeStack — Type
SizeStack

Transparent size trait type where inputs are stacked, i.e output size is the sum of all input sizes.

source
NaiveNASlib.SizeInvariant — Type
SizeInvariant

Transparent size trait type where all input sizes must be equal to the output size, e.g. elementwise operations (including broadcasted).

source
NaiveNASlib.FixedSizeTrait — Type
FixedSizeTrait <: DecoratingTrait

Trait which indicates that a vertex is SizeTransparent while still having a fixed size.

This prevents NaiveNASlib from inferring the size from neighbouring vertices.

As an example, the function x -> 2 .* x accepts any size of x, while the function x -> [1,2,3] .* x is SizeInvariant but has a fixed size of 3.

Note that FixedSizeTrait does not imply that the vertex can't change size.

source