Skip to content

Commit

Permalink
Remove target from Shared Tensor constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Feb 5, 2024
1 parent 87b0fcd commit ae4fe70
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pytensor/tensor/sharedvar.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def tensor_constructor(
allow_downcast=None,
borrow=False,
shape=None,
target="cpu",
broadcastable=None,
):
r"""`SharedVariable` constructor for `TensorType`\s.
Expand All @@ -85,9 +84,6 @@ def tensor_constructor(
)
shape = broadcastable

if target != "cpu":
raise TypeError("not for cpu")

# If no shape is given, then the default is to assume that the value might
# be resized in any dimension in the future.
if shape is None:
Expand All @@ -109,7 +105,7 @@ def tensor_constructor(
@shared_constructor.register(int)
@shared_constructor.register(complex)
def scalar_constructor(
value, name=None, strict=False, allow_downcast=None, borrow=False, target="cpu"
value, name=None, strict=False, allow_downcast=None, borrow=False
):
"""`SharedVariable` constructor for scalar values.
Expand All @@ -124,9 +120,6 @@ def scalar_constructor(
borrow, as it is a hint to PyTensor that we can reuse it.
"""
if target != "cpu":
raise TypeError("not for cpu")

try:
dtype = value.dtype
except AttributeError:
Expand Down

0 comments on commit ae4fe70

Please sign in to comment.