diff --git a/pgmpy/sampling/HMC.py b/pgmpy/sampling/HMC.py index d4c7a47e3..5a4c8c115 100644 --- a/pgmpy/sampling/HMC.py +++ b/pgmpy/sampling/HMC.py @@ -262,7 +262,8 @@ def sample(self, initial_pos, num_samples, trajectory_length, stepsize=None, ret # Genrating sample position_m, _ = self._sample(position_m, trajectory_length, stepsize, lsteps) - samples[i] = position_m + position_m_out = np.core.records.fromarrays(position_m, dtype=samples[i].dtype) + samples[i] = position_m_out self.acceptance_rate = self.accepted_proposals / num_samples