Kernel dies when I use a tensor of size greater than 127 in a linear layer (on Mac M1)

Could you execute the script in a terminal and check, if you get a valid error message (I assume you are using a Jupyter Notebook at the moment).
If you get an error message, could you post it here, please?