I run the code on the CPU, and this are the variables with the sizes:
y_hat size is: torch.Size([12, 14])
y_hat values:
tensor([[0.6129, 0.5309, 0.5493, 0.5381, 0.3087, 0.5583, 0.6137, 0.5149, 0.4085,
         0.5862, 0.2384, 0.5680, 0.5260, 0.4991],
        [0.6569, 0.5384, 0.5118, 0.5537, 0.2853, 0.5693, 0.5910, 0.5591, 0.4307,
         0.6214, 0.2627, 0.5559, 0.4875, 0.5189],
        [0.6661, 0.5641, 0.5279, 0.5512, 0.2661, 0.5696, 0.6380, 0.5634, 0.4121,
         0.6507, 0.2291, 0.5484, 0.5269, 0.5167],
        [0.6080, 0.5319, 0.5410, 0.5360, 0.3337, 0.5400, 0.6016, 0.5272, 0.4206,
         0.5621, 0.2836, 0.5702, 0.5462, 0.5181],
        [0.6449, 0.5319, 0.5020, 0.5396, 0.3185, 0.5530, 0.6014, 0.5320, 0.4364,
         0.5910, 0.2769, 0.5569, 0.5150, 0.5478],
        [0.6354, 0.5295, 0.5082, 0.5238, 0.3286, 0.5463, 0.6044, 0.5155, 0.4336,
         0.5611, 0.2828, 0.5773, 0.5416, 0.5526],
        [0.6253, 0.5377, 0.5210, 0.5412, 0.3121, 0.5338, 0.5989, 0.5410, 0.4344,
         0.5828, 0.2790, 0.5386, 0.4860, 0.5109],
        [0.5994, 0.5170, 0.5295, 0.5254, 0.3505, 0.5416, 0.5829, 0.5294, 0.4342,
         0.5438, 0.2987, 0.5563, 0.5430, 0.5301],
        [0.7066, 0.6006, 0.5521, 0.5716, 0.2426, 0.5623, 0.7090, 0.5899, 0.3890,
         0.7019, 0.1959, 0.5618, 0.5408, 0.5389],
        [0.6898, 0.5965, 0.5376, 0.5712, 0.2483, 0.5569, 0.6715, 0.5582, 0.4050,
         0.6706, 0.2231, 0.5759, 0.5098, 0.5386],
        [0.7319, 0.6521, 0.5477, 0.6104, 0.1955, 0.5622, 0.7457, 0.5822, 0.3798,
         0.7330, 0.1674, 0.6016, 0.5055, 0.5282],
        [0.6339, 0.5636, 0.5512, 0.5806, 0.3190, 0.5315, 0.5829, 0.5866, 0.4368,
         0.5918, 0.2504, 0.5495, 0.5461, 0.4653]], grad_fn=<SigmoidBackward>)

t size is: torch.Size([12, 14])
t values:
tensor([[0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1.],
        [0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.],
        [0., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
        [0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.],
        [0., 0., 0., 0., 0., 0., 1., 0., 0., 1., 0., 0., 0., 0.],
        [0., 0., 0., 0., 1., 0., 0., 0., 1., 0., 0., 0., 0., 0.],
        [0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
        [0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0.],
        [0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
        [1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.],
        [0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
        [0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.]])

pos_w size is: torch.Size([14])
pos_w values:
tensor([0.7754, 0.9461, 0.9093, 0.9552, 0.7428, 0.9514, 0.9681, 0.9956, 0.6159,
        0.8887, 0.8778, 0.9344, 0.9717, 0.8984])

neg_w size is: torch.Size([14])
neg_w values:
tensor([0.2246, 0.0539, 0.0907, 0.0448, 0.2572, 0.0486, 0.0319, 0.0044, 0.3841,
        0.1113, 0.1222, 0.0656, 0.0283, 0.1016])

I was indeed mistaken and I apologize for that.