--
--
-- Tensor
--
--

tensorOrder %A := length (tensorShape A)

unitTensor ns := generateTensor kroneckerDelta ns

scalarToTensor x ns := x * unitTensor ns

zeroTensor ns := generateTensor (cambda xs -> 0) ns

(.') %t1 %t2 := sum' (contract (t1 *' t2))

(.) %t1 %t2 := sum (contract (t1 * t2))
