Skip to content

Commit efa822c

Browse files
committed
Modify docstrings for get_scalar_constant method
1 parent 19fbcf8 commit efa822c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytensor/tensor/basic.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ def _obj_is_wrappable_as_tensor(x):
257257

258258
def get_scalar_constant(v, elemwise=True, only_process_constants=False, max_recur=10):
259259
"""
260-
Checks whether 'v' is a scalar based on 'ndim'
260+
Checks whether 'v' is a scalar (ndim = 0).
261+
262+
If 'v' is a scalar then this function fetches the underlying constant by calling
263+
'get_underlying_scalar_constant()'.
264+
265+
If 'v' is not a scalar, it raises a NotScalarConstantError.
266+
261267
"""
262268
if isinstance(v, np.ndarray):
263269
data = v.data

0 commit comments

Comments
 (0)