Skip to content

Commit b94af96

Browse files
committed
Fix bug in xtensor_constant
1 parent 1e9f8e1 commit b94af96

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pytensor/xtensor/type.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,9 @@ def xtensor_constant(x, name=None, dims: None | Sequence[str] = None):
502502
if x_data.ndim == 0:
503503
x_dims = ()
504504
else:
505-
"Cannot convert TensorLike constant to XTensorConstant without specifying dims."
505+
raise TypeError(
506+
"Cannot convert TensorLike constant to XTensorConstant without specifying dims."
507+
)
506508
try:
507509
return XTensorConstant(
508510
XTensorType(dtype=x_data.dtype, dims=x_dims, shape=x_data.shape),

0 commit comments

Comments
 (0)