I found a solution, but I wonder if there exist any simpler solution?
def ev(a, b):
    N = b.shape[0]
    shp = b.shape[1:]
    return torch.mul(a, b.view(N, -1).transpose(0,1)).transpose(0,1).view(N, *shp)

R = ev(v, A) # gives the right answer