input: Write a python function to count the occurrences of each element in a 2D numpy array.
  assert count_occurrences(np.array([[1,2,3], [2,3,4], [2,1,3]])) == {1: 2, 2: 3, 3: 3, 4: 1}
  assert count_occurrences(np.array([[5,6,6], [6,7,8], [5,9,5]])) == {5: 3, 6: 3, 7: 1, 8: 1, 9: 1}
  assert count_occurrences(np.array([[1,2,2], [3,3,3], [4,4,4]])) == {1: 1, 2: 2, 3: 3, 4: 3}
output: import numpy as np
  
  def count_occurrences(arr):
      unique, counts = np.unique(arr, return_counts=True)
      return dict(zip(unique, counts))