Skip to content

Commit 2a2b254

Browse files
authored
Merge pull request #1014 from FlorianPfaff/copy_vmf
Use copy when setting mean of vmf
2 parents 929f181 + e17f080 commit 2a2b254

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

pyrecest/distributions/hypersphere_subset/von_mises_fisher_distribution.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
zeros,
2424
)
2525
from scipy.special import iv
26-
26+
import copy
2727
from .abstract_hyperspherical_distribution import AbstractHypersphericalDistribution
2828

2929

@@ -127,11 +127,14 @@ def from_mean_resultant_vector(m):
127127

128128
def mode(self):
129129
return self.mu
130+
131+
def set_mean(self, new_mean):
132+
self.set_mode(new_mean)
130133

131134
def set_mode(self, new_mode):
132135
assert new_mode.shape == self.mu.shape
133136
dist = self
134-
dist.mu = new_mode
137+
dist.mu = copy.deepcopy(new_mode)
135138
return dist
136139

137140
def multiply(self, other: "VonMisesFisherDistribution"):

0 commit comments

Comments
 (0)