Skip to content

Commit dffad9a

Browse files
committed
Remove target from Shared Tensor constructors
1 parent 5cfd9da commit dffad9a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pytensor/tensor/sharedvar.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def tensor_constructor(
6565
allow_downcast=None,
6666
borrow=False,
6767
shape=None,
68-
target="cpu",
6968
broadcastable=None,
7069
):
7170
r"""`SharedVariable` constructor for `TensorType`\s.
@@ -87,9 +86,6 @@ def tensor_constructor(
8786
)
8887
shape = broadcastable
8988

90-
if target != "cpu":
91-
raise TypeError("not for cpu")
92-
9389
# If no shape is given, then the default is to assume that the value might
9490
# be resized in any dimension in the future.
9591
if shape is None:
@@ -111,7 +107,7 @@ def tensor_constructor(
111107
@shared_constructor.register(int)
112108
@shared_constructor.register(complex)
113109
def scalar_constructor(
114-
value, name=None, strict=False, allow_downcast=None, borrow=False, target="cpu"
110+
value, name=None, strict=False, allow_downcast=None, borrow=False
115111
):
116112
"""`SharedVariable` constructor for scalar values.
117113
@@ -126,9 +122,6 @@ def scalar_constructor(
126122
borrow, as it is a hint to PyTensor that we can reuse it.
127123
128124
"""
129-
if target != "cpu":
130-
raise TypeError("not for cpu")
131-
132125
try:
133126
dtype = value.dtype
134127
except AttributeError:

0 commit comments

Comments
 (0)