This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed trait Tensor[V] { | |
val n, m: Int | |
def apply(vs: List[V], vds: List[V => Double]): Double | |
} | |
case class TUnit[V](v: V) extends Tensor[V] { | |
val n = 1 | |
val m = 0 | |
def apply(vs: List[V], vds: List[V => Double]): Double = vds head(v) | |
} |