Tensors
object Tensors
Type members
Classlikes
Types
type AddGivenAxisSize[S <: Shape, S1 <: Shape, AxisIndices <: None.type | Indices] = AxisIndices match {
case None.type => SNil
case Indices => AddGivenAxisSizeLoop[S, S1, AxisIndices, 0]
}
type FlattenedShape[S <: Shape, AxisIndex <: None.type | Indices] = AxisIndex match {
case None.type => SNil
case Indices => FlattenedShapeLoop[S, AxisIndex, 0, 1]
}
type GatheredShape[S <: Shape, AxisIndex <: None.type | Indices, AxisIndices <: Indices] = AxisIndex match {
case None.type => SNil
case Indices => GatheredShapeLoop[S, AxisIndex, 0, AxisIndices]
}
type IndicesSizeLoop[AxisIndices <: Indices, Acc <: Dimension] = AxisIndices match {
case head ::: tail => IndicesSizeLoop[tail, S[Acc]]
case INil => Acc
}
type KeepOrReduceDimDenotations[Td <: TensorShapeDenotation, AxisIndices <: None.type | Indices, KeepDims <: Boolean & Singleton] = KeepDims match {
case true => Td
case false => Reduce[Td, AxisIndices]
}
type KeepOrReduceDims[S <: Shape, AxisIndices <: None.type | Indices, KeepDims <: Boolean & Singleton] = KeepDims match {
case true => ReduceKeepDims[S, AxisIndices]
case false => Reduce[S, AxisIndices]
}
type PaddedShape[PadFrom <: Shape, AxisBefore <: None.type | Shape, AxisAfter <: None.type | Shape] = AxisBefore match {
case None.type => PadFrom
case Shape => AxisAfter match {
case None.type => PadFrom
case Shape => Reverse[PaddedShapeLoop[Reverse[PadFrom], Reverse[AxisBefore], Reverse[AxisAfter]]]
}
}
type PoolShape[From <: Shape, KernelShape <: None.type | Shape] = KernelShape match {
case None.type => SNil
case Shape => Reverse[PoolShapeLoop[Reverse[From], Reverse[KernelShape]]]
}
type ReduceKeepDims[S <: Shape, AxisIndices <: None.type | Indices] = AxisIndices match {
case None.type => SNil
case Indices => ReduceKeepDimsLoop[S, AxisIndices, 0]
}
type SlicedShape[AxisIndicesStarts <: None.type | Indices, AxisIndicesEnds <: None.type | Indices] = AxisIndicesStarts match {
case None.type => SNil
case Indices => AxisIndicesEnds match {
case None.type => SNil
case Indices => SlicedShapeLoop[AxisIndicesStarts, AxisIndicesEnds]
}
}
type Supported = Int | Long | Float | Double | Byte | Short | UByte | UShort | UInt | ULong | Boolean | String | BFloat16 | Float16 | Complex[Float] | Complex[Double]
type TiledShape[TileFrom <: Shape, AxisRepeats <: None.type | Indices] = AxisRepeats match {
case None.type => SNil
case Indices => TiledShapeLoop[TileFrom, AxisRepeats]
}
type UnsqueezeShape[S <: Shape, AxisIndex <: None.type | Indices] = AxisIndex match {
case None.type => SNil
case Indices => UnsqueezeShapeLoop[S, AxisIndex, 0]
}