Skip to content

Commit

Permalink
Numpy Import Convention (#3307)
Browse files Browse the repository at this point in the history
* Added torch.clamp inside torch.log calls

Added torch.clamp in torch.log to avoid too small numbers, which would result in NaN

* Added "as np" to numpy import

Added "as np" to numpy import, matching standard convention and consistency in code

* Fix pylint issues

* Revert "Added torch.clamp inside torch.log calls"

This reverts commit 87f5064.
  • Loading branch information
RatishT committed Dec 21, 2023
1 parent 834ff63 commit 579163a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyro/contrib/epidemiology/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0

import numpy
import numpy as np
import torch

import pyro
Expand Down Expand Up @@ -168,7 +168,7 @@ def align_samples(samples, model, particle_dim):
],
]

W16 = numpy.array(W16)
W16 = np.array(W16)


def compute_bin_probs(s, num_quant_bins):
Expand Down

0 comments on commit 579163a

Please sign in to comment.