Skip to content

Commit f0cdb1f

Browse files
committed
Pass rv to _default_transform dispatch function
1 parent 324d900 commit f0cdb1f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

pymc/distributions/continuous.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,17 @@ class CircularContinuous(Continuous):
141141

142142

143143
@_default_transform.register(PositiveContinuous)
144-
def pos_cont_transform(op):
144+
def pos_cont_transform(op, rv):
145145
return transforms.log
146146

147147

148148
@_default_transform.register(UnitContinuous)
149-
def unit_cont_transform(op):
149+
def unit_cont_transform(op, rv):
150150
return transforms.logodds
151151

152152

153153
@_default_transform.register(CircularContinuous)
154-
def circ_cont_transform(op):
154+
def circ_cont_transform(op, rv):
155155
return transforms.circular
156156

157157

pymc/distributions/transforms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
Simplex,
2626
)
2727
from aesara.graph import Op
28+
from aesara.tensor import TensorVariable
2829

2930
__all__ = [
3031
"RVTransform",
@@ -42,7 +43,7 @@
4243

4344

4445
@singledispatch
45-
def _default_transform(op: Op):
46+
def _default_transform(op: Op, rv: TensorVariable):
4647
"""Return default transform for a given Distribution `Op`"""
4748
return None
4849

pymc/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ def create_value_var(
14221422
# Make the value variable a transformed value variable,
14231423
# if there's an applicable transform
14241424
if transform is UNSET and rv_var.owner:
1425-
transform = _default_transform(rv_var.owner.op)
1425+
transform = _default_transform(rv_var.owner.op, rv_var)
14261426

14271427
if transform is not None and transform is not UNSET:
14281428
value_var.tag.transform = transform

0 commit comments

Comments
 (0)