function sizeFromShape(shape) {
	  if (shape.length === 0) {
	    // Scalar.
	    return 1;
	  }

	  var size = shape[0];

	  for (var i = 1; i < shape.length; i++) {
	    size *= shape[i];
	  }

	  return size;
	}
Returns the size (number of elements) of the tensor given its shape.

```js
const shape = [3, 4, 2];
const size = tf.util.sizeFromShape(shape);
console.log(size);
```

@doc {heading: 'Util', namespace: 'util'}