Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatV committed Oct 23, 2023
1 parent 3a454ea commit 4b17276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -5094,7 +5094,7 @@ def multigammaln_(x, p, name=None):
c = 0.25 * p * (p - 1) * math.log(math.pi)
c = paddle.to_tensor(c, dtype=x.dtype)
b = 0.5 * paddle.arange(start=(1 - p), end=1, step=1, dtype=x.dtype)
x[:] = (x.unsqueeze(-1) + b).lgamma_().sum(-1).add_(c)
paddle.assign((x.unsqueeze(-1) + b).lgamma_().sum(-1).add_(c), x)
return x


Expand Down
3 changes: 3 additions & 0 deletions test/legacy_test/test_inplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,9 @@ def inplace_api_processing(self, var):
def non_inplace_api_processing(self, var):
return paddle.multigammaln(var, self.p)

def test_leaf_inplace_var_error(self):
pass


class TestDygraphInplaceNeg(TestDygraphInplaceWithContinuous):
def inplace_api_processing(self, var):
Expand Down

0 comments on commit 4b17276

Please sign in to comment.