First of all, all things should be wrapped into Variable for W to be trainable. Secondly, W has shape (32,), which is not multiply-able with tensors of shape (2 3). So I assume that W is of shape (3, 2).
Then, you can use torch.bmm(data, W.unsqueeze(0).expand(10, 3, 2)). Probably you don’t need unsqueeze but I don’t have access to pytorch right now so you can check your self.