I also did torch::linalg::linalg_norm(tensor, 2, {2}, false); I did not work.
Then tried
      int64_t arr[1] = {2};
      c10::IntArrayRef dim_arr = c10::IntArrayRef(arr, 1);
      result = torch::linalg::linalg_norm(
          tensor, 2, dim_arr, false, torch::dtype(torch::kFloat));

Still same error.