i didn’t understand what you did with the @ but that’s what i said no?
i want to learn a representation only on top row of a matrix, called embed:
embed = torch.randn((1,10,10),requires_grad=True)
mask =torch.zeros((1,10,10),requires_grad=False)
mask[0,0,:] = 1
embed = embed * mask

now build the network with embed where i want it to be.

p.s
the reason i want it still to be a matrix is because of the architecture that can only accept a matrix at that point.