Skip to content

Commit 5bd100e

Browse files
author
Ian Schweer
committed
Better docstring
1 parent d00f9e2 commit 5bd100e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pytensor/link/pytorch/dispatch/elemwise.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,9 @@ def softmax_grad(dy, sm):
185185

186186
def elemwise_ravel_fn(base_fn, op, node, **kwargs):
187187
"""
188-
ScalarLoop + Elemwise is too common
189-
to not work, but https://github.com/pymc-devs/pytensor/issues/1031,
190-
vmap won't allow it. Instead, we can ravel all the inputs, broadcasted
191-
according to torch
188+
Dispatch methods using `.item()` (ScalarLoop + Elemwise) is common, but vmap
189+
in torch has a limitation: https://github.com/pymc-devs/pytensor/issues/1031,
190+
Instead, we can ravel all the inputs, broadcasted according to torch
192191
"""
193192

194193
n_outputs = len(node.outputs)

tests/link/pytorch/test_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def test_pytorch_softplus():
393393
f = FunctionGraph([x], [out])
394394
compare_pytorch_and_py(f, [np.random.rand(3)])
395395

396+
396397
def test_ScalarLoop():
397398
n_steps = int64("n_steps")
398399
x0 = float64("x0")

0 commit comments

Comments
 (0)