Shape

Utilities for tensor shapes represented as int list.

FunctionDescription
elemCount shapeReturn the total number of elements (product of dimensions).
ofInt64Array shapeConvert from an int64 array.
rank shapeReturn the number of dimensions.
toInt64Array shapeConvert to an int64 array.

elemCount

elemCount shape

Return the total number of elements (product of dimensions).

Parameters

  • shape : int list

Returns int64


ofInt64Array

ofInt64Array shape

Convert from an int64 array.

Parameters

  • shape : int64 array

Returns int list


rank

rank shape

Return the number of dimensions.

Parameters

  • shape : int list

Returns int


toInt64Array

toInt64Array shape

Convert to an int64 array.

Parameters

  • shape : int list

Returns int64 array