verify that dimension matches for A*B element wise