You should pass your parameter into this function, e.g.:
in_v, out_v = init._calculate_fan_in_and_fan_out(m.weight)

Besides that the code won’t work as it seems you are trying to call a scipy.stats function on X.
X.rvs is not defined, since X will be a tensor sampled from the normal distribution.
@livenletdie_gvs explained your initial code in this thread 4.