Solved by iacob in post #9 
              
              
                You can broadcast a vector to a higher dimensional tensor like so: 
def row_mult(t,vec):
    extra_dims = (1,)*(t.dim()-1)
    return t * vec.view(-1, *extra_dims)