Skip to content

Commit f8dbd5c

Browse files
committed
Fix bug in xtensor_constant
1 parent ff63514 commit f8dbd5c

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
@@ -504,7 +504,9 @@ def xtensor_constant(x, name=None, dims: None | Sequence[str] = None):
504504
if x_data.ndim == 0:
505505
x_dims = ()
506506
else:
507-
"Cannot convert TensorLike constant to XTensorConstant without specifying dims."
507+
raise TypeError(
508+
"Cannot convert TensorLike constant to XTensorConstant without specifying dims."
509+
)
508510
try:
509511
return XTensorConstant(
510512
XTensorType(dtype=x_data.dtype, dims=x_dims, shape=x_data.shape),

0 commit comments

Comments
 (0)