Skip to content

Commit

Permalink
Change at.zeros to at.empty when creating combined observed/missi…
Browse files Browse the repository at this point in the history
…ng vector

Co-authored-by: Ricardo Vieira <28983449+ricardoV94@users.noreply.github.com>
  • Loading branch information
2 people authored and michaelosthege committed Jan 12, 2023
1 parent 3b509ed commit a37ec86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymc/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ def make_obs_var(

# Create deterministic that combines observed and missing
# Note: This can widely increase memory consumption during sampling for large datasets
rv_var = at.zeros(data.shape, dtype=observed_rv_var.type.dtype)
rv_var = at.empty(data.shape, dtype=observed_rv_var.type.dtype)
rv_var = at.set_subtensor(rv_var[mask.nonzero()], missing_rv_var)
rv_var = at.set_subtensor(rv_var[antimask_idx], observed_rv_var)
rv_var = Deterministic(name, rv_var, self, dims)
Expand Down

0 comments on commit a37ec86

Please sign in to comment.