提交 dffad9aa authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Remove target from Shared Tensor constructors

上级 5cfd9da9
...@@ -65,7 +65,6 @@ def tensor_constructor( ...@@ -65,7 +65,6 @@ def tensor_constructor(
allow_downcast=None, allow_downcast=None,
borrow=False, borrow=False,
shape=None, shape=None,
target="cpu",
broadcastable=None, broadcastable=None,
): ):
r"""`SharedVariable` constructor for `TensorType`\s. r"""`SharedVariable` constructor for `TensorType`\s.
...@@ -87,9 +86,6 @@ def tensor_constructor( ...@@ -87,9 +86,6 @@ def tensor_constructor(
) )
shape = broadcastable 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 # If no shape is given, then the default is to assume that the value might
# be resized in any dimension in the future. # be resized in any dimension in the future.
if shape is None: if shape is None:
...@@ -111,7 +107,7 @@ def tensor_constructor( ...@@ -111,7 +107,7 @@ def tensor_constructor(
@shared_constructor.register(int) @shared_constructor.register(int)
@shared_constructor.register(complex) @shared_constructor.register(complex)
def scalar_constructor( 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. """`SharedVariable` constructor for scalar values.
...@@ -126,9 +122,6 @@ def scalar_constructor( ...@@ -126,9 +122,6 @@ def scalar_constructor(
borrow, as it is a hint to PyTensor that we can reuse it. borrow, as it is a hint to PyTensor that we can reuse it.
""" """
if target != "cpu":
raise TypeError("not for cpu")
try: try:
dtype = value.dtype dtype = value.dtype
except AttributeError: except AttributeError:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论