@ptrblck This time I tried not to tag you but I didn’t receive any response, so i had to tag you again  
Note: The weights become NaN after the model perform optim.step()  operation
**Weights before *optim.step()***

tensor([[[ 0.0216, -0.0274,  0.0092,  0.0200,  0.0098],
         [ 0.0302,  0.0371,  0.0188,  0.0294,  0.0384],
         [ 0.0126, -0.0456, -0.0403, -0.0410,  0.0268],
         ...,
         [-0.0453, -0.0446,  0.0200,  0.0058,  0.0293],
         [-0.0332,  0.0131,  0.0335, -0.0257, -0.0236],
         [-0.0450, -0.0447,  0.0255,  0.0492, -0.0292]],

        [[-0.0161,  0.0003,  0.0291, -0.0007,  0.0112],
         [ 0.0287, -0.0169,  0.0059,  0.0356, -0.0112],
         [-0.0397, -0.0554, -0.0096,  0.0362,  0.0300],
         ...,
         [-0.0120, -0.0267, -0.0218, -0.0219, -0.0436],
         [ 0.0274, -0.0510, -0.0040, -0.0502,  0.0355],
         [ 0.0230, -0.0012, -0.0350,  0.0491,  0.0433]],

        [[-0.0398, -0.0122, -0.0506, -0.0266, -0.0049],
         [-0.0192, -0.0178, -0.0416, -0.0558,  0.0473],
         [ 0.0518,  0.0558,  0.0386, -0.0165,  0.0240],
         ...,
         [ 0.0546, -0.0279,  0.0175, -0.0328, -0.0483],
         [ 0.0532, -0.0204,  0.0396,  0.0378, -0.0361],
         [ 0.0267, -0.0551, -0.0053, -0.0142, -0.0090]],

        ...,

        [[-0.0477, -0.0505,  0.0310,  0.0422,  0.0457],
         [-0.0293, -0.0361, -0.0409, -0.0054,  0.0356],
         [ 0.0281,  0.0491, -0.0228,  0.0474, -0.0226],
         ...,
         [ 0.0085,  0.0486, -0.0494,  0.0506,  0.0161],
         [ 0.0318,  0.0403, -0.0126, -0.0433,  0.0090],
         [ 0.0186, -0.0376,  0.0377, -0.0441,  0.0089]],

        [[-0.0529, -0.0501,  0.0453, -0.0431, -0.0019],
         [-0.0292,  0.0338,  0.0170,  0.0268, -0.0038],
         [-0.0112,  0.0170,  0.0096, -0.0053, -0.0020],
         ...,
         [ 0.0211,  0.0496, -0.0416,  0.0355, -0.0046],
         [ 0.0255,  0.0460,  0.0415, -0.0307,  0.0130],
         [ 0.0048,  0.0503,  0.0074, -0.0438, -0.0265]],

        [[ 0.0247,  0.0221, -0.0234,  0.0502, -0.0549],
         [-0.0090, -0.0014,  0.0221,  0.0153,  0.0137],
         [ 0.0230,  0.0089, -0.0253,  0.0080, -0.0016],
         ...,
         [-0.0449, -0.0292,  0.0301, -0.0041,  0.0114],
         [ 0.0387,  0.0142, -0.0176,  0.0145,  0.0414],
         [ 0.0173,  0.0252,  0.0454,  0.0539, -0.0155]]], requires_grad=True)

**Weights after *optim.step()***

tensor([[[ 0.0216,     nan,     nan,     nan,     nan],
         [ 0.0302,     nan,     nan,     nan,     nan],
         [ 0.0126,     nan,     nan,     nan,     nan],
         ...,
         [-0.0453,     nan,     nan,     nan,     nan],
         [-0.0332,     nan,     nan,     nan,     nan],
         [-0.0450,     nan,     nan,     nan,     nan]],

        [[-0.0161,     nan,     nan,     nan,     nan],
         [ 0.0287,     nan,     nan,     nan,     nan],
         [-0.0397,     nan,     nan,     nan,     nan],
         ...,
         [-0.0120,     nan,     nan,     nan,     nan],
         [ 0.0274,     nan,     nan,     nan,     nan],
         [ 0.0230,     nan,     nan,     nan,     nan]],

        [[-0.0398,     nan,     nan,     nan,     nan],
         [-0.0192,     nan,     nan,     nan,     nan],
         [ 0.0518,     nan,     nan,     nan,     nan],
         ...,
         [ 0.0546,     nan,     nan,     nan,     nan],
         [ 0.0532,     nan,     nan,     nan,     nan],
         [ 0.0267,     nan,     nan,     nan,     nan]],

        ...,

        [[-0.0477,     nan,     nan,     nan,     nan],
         [-0.0293,     nan,     nan,     nan,     nan],
         [ 0.0281,     nan,     nan,     nan,     nan],
         ...,
         [ 0.0085,     nan,     nan,     nan,     nan],
         [ 0.0318,     nan,     nan,     nan,     nan],
         [ 0.0186,     nan,     nan,     nan,     nan]],

        [[-0.0529,     nan,     nan,     nan,     nan],
         [-0.0292,     nan,     nan,     nan,     nan],
         [-0.0112,     nan,     nan,     nan,     nan],
         ...,
         [ 0.0211,     nan,     nan,     nan,     nan],
         [ 0.0255,     nan,     nan,     nan,     nan],
         [ 0.0048,     nan,     nan,     nan,     nan]],

        [[ 0.0247,     nan,     nan,     nan,     nan],
         [-0.0090,     nan,     nan,     nan,     nan],
         [ 0.0230,     nan,     nan,     nan,     nan],
         ...,
         [-0.0449,     nan,     nan,     nan,     nan],
         [ 0.0387,     nan,     nan,     nan,     nan],
         [ 0.0173,     nan,     nan,     nan,     nan]]], requires_grad=True)