From a252df05887604efdae1d7885aa286dfd46ee605 Mon Sep 17 00:00:00 2001 From: Erlend Aune Date: Thu, 5 Apr 2018 16:11:42 +0200 Subject: [PATCH] Fix bug to be able to use numpy 1.14+ --- pgmpy/sampling/HMC.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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