Skip to content

Commit 74d7825

Browse files
committed
Clarify behavior of Elemwise second
1 parent 0b558d8 commit 74d7825

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pytensor/tensor/basic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,12 @@ def switch(cond, ift, iff):
765765

766766
@scalar_elemwise
767767
def second(a, b):
768-
"""Create a matrix by filling the shape of a with b"""
768+
"""Create a matrix by filling the broadcasted shapes of a and b with the values of b
769+
770+
Equivalent to `np.broadcast_arrays(a, b)[1]`
771+
Equivalent to `np.array(a).fill(b)` when b is a scalar value.
772+
773+
"""
769774

770775

771776
fill = second

0 commit comments

Comments
 (0)