提交 03e5f772 authored 作者: ricardoV94's avatar ricardoV94 提交者: Luciano Paz

Fix typo in `__setitem__` error message

上级 4f7d7096
......@@ -598,7 +598,7 @@ class _tensor_py_operators:
def __setitem__(self, key, value):
raise TypeError(
"TensorVariable does not support item assignment. Use the output of `set` or `add` instead."
"TensorVariable does not support item assignment. Use the output of `x[idx].set` or `x[idx].inc` instead."
)
def take(self, indices, axis=None, mode="raise"):
......
import re
from copy import copy
import numpy as np
......@@ -444,7 +445,7 @@ class TestTensorInstanceMethods:
def test_set_item_error(self):
x = matrix("x")
msg = "Use the output of `set` or `add` instead."
msg = re.escape("Use the output of `x[idx].set` or `x[idx].inc` instead.")
with pytest.raises(TypeError, match=msg):
x[0] = 5
with pytest.raises(TypeError, match=msg):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论