<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def size(self):
 """Total number of grid points."""

        # Since np.prod(()) == 1.0 we need to handle that by ourselves
        return (0 if self.shape == () else
                int(np.prod(self.shape, dtype='int64')))