import sys
import numpy as np
a = np.linspace(0, 10, 8, dtype=np.float64)
b = np.linspace(0, 10, 8, dtype=np.float32)
c = np.linspace(0, 10, 8, dtype=np.float16)
print(f'float64 size: {sys.getsizeof(a)} bytes\nfloat32 size: {sys.getsizeof(b)} bytes'
f'\nfloat16 size: {sys.getsizeof(c)} bytes')
which results the following:
float64 size: 104 bytes
float32 size: 136 bytes
float16 size: 120 bytes