I want to plot a statistical graph that shows the number of occurrences of each values in a torch tensor ? Thank you

Have a look at the histogram (histc) function here.

histc