Skip to content

Commit 573e0f7

Browse files
committed
Better docstrings for set and add helpers
1 parent 9d5a825 commit 573e0f7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pytensor/tensor/variable.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,9 @@ def compress(self, a, axis=None):
816816
return at.extra_ops.compress(self, a, axis=axis)
817817

818818
def set(self, y, **kwargs):
819-
"""Set values to y, where y is the output of an index operation.
819+
"""Return a copy of a tensor with the indexed values set to y.
820+
821+
Self must be the output of an indexing operation.
820822
821823
Equivalent to set_subtensor(self, y). See docstrings for kwargs.
822824
@@ -829,9 +831,11 @@ def set(self, y, **kwargs):
829831
return at.subtensor.set_subtensor(self, y, **kwargs)
830832

831833
def add(self, y, **kwargs):
832-
"""Add values to y, where y is the output of an index operation.
834+
"""Return a copy of a tensor with the indexed values incremented by y.
835+
836+
Self must be the output of an indexing operation.
833837
834-
Equivalent to inc_subtensor(self, y). See docstrings for kwargs
838+
Equivalent to inc_subtensor(self, y). See docstrings for kwargs.
835839
836840
Examples
837841
--------

0 commit comments

Comments
 (0)