Compute the total number of logical elements from a shape.
Product of all dimensions, or 1 for a scalar (empty shape)
Logical element dimensions