11 lines
171 B
Python

import numpy as np
from parser.types import ValueType
def size(x: ValueType) -> int:
if isinstance(x, np.ndarray):
return x.size
else:
return 1