size

open val size: Int

The total number of elements of this tensor.

Samples

import org.diffkt.FloatScalar
import org.diffkt.reshape
import org.diffkt.tensorOf
fun main() { 
   //sampleStart 
   val tensor = tensorOf(1.0f, 2.0f, 3.0f, 4.0f).reshape(2,2)
val size = tensor.size
println("size = ${size}")
// output should be
// size = 4 
   //sampleEnd
}