Skip to content

Commit

Permalink
Add more comments about shape/broadcastable
Browse files Browse the repository at this point in the history
  • Loading branch information
vandalt committed Oct 28, 2023
1 parent e068802 commit 8021434
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/exoplanet_core/pymc/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,12 @@ def make_node(self, b, r):
raise ValueError("float64 precision is required")
x = in_args[0]
o = [
# NOTE: Changed arg broadcastable to shape because of deprecation warning,
# BUT this might change again in the future: https://github.com/pymc-devs/pytensor/issues/408
# The other option is to use `x.type.shape + (3,)`
# Ref: https://pytensor.readthedocs.io/en/latest/library/tensor/basic.html#pytensor.tensor.TensorType
pt.tensor(
# NOTE: Changed broadcastable to shape because it caused deprecation warning,
# BUT this might change again in the future: https://github.com/pymc-devs/pytensor/issues/408
# PyTensor internally converts True to None and False to 1
shape=tuple(x.broadcastable) + (False,),
dtype=x.dtype,
)
Expand Down Expand Up @@ -211,9 +214,12 @@ def make_node(self, a, e, cosw, sinw, cosi, sini, L):
out_args = [
in_args[0].type(),
in_args[0].type(),
# NOTE: Changed arg broadcastable to shape because of deprecation warning,
# BUT this might change again in the future: https://github.com/pymc-devs/pytensor/issues/408
# The other option is to use `in_args[0].type.shape`
# Ref: https://pytensor.readthedocs.io/en/latest/library/tensor/basic.html#pytensor.tensor.TensorType
pt.tensor(
# NOTE: Changed broadcastable to shape because it caused deprecation warning,
# BUT this might change again in the future: https://github.com/pymc-devs/pytensor/issues/408
# PyTensor internally converts True to None and False to 1
shape=tuple(in_args[0].broadcastable),
dtype="int32",
),
Expand Down

0 comments on commit 8021434

Please sign in to comment.