mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
set_index -> _set_index
This commit is contained in:
@ -251,7 +251,6 @@ view of a storage and defines numeric operations on it.
|
||||
.. automethod:: scatter_
|
||||
.. automethod:: select
|
||||
.. automethod:: set_
|
||||
.. automethod:: set_index
|
||||
.. automethod:: share_memory_
|
||||
.. automethod:: short
|
||||
.. automethod:: sigmoid
|
||||
|
@ -1274,13 +1274,6 @@ Args:
|
||||
stride (tuple): The desired stride. Defaults to C-contiguous strides.
|
||||
""")
|
||||
|
||||
add_docstr(torch._C.FloatTensorBase.set_index,
|
||||
"""
|
||||
set_index(index, value)
|
||||
|
||||
Alias for ``self[index] = value``
|
||||
""")
|
||||
|
||||
add_docstr(torch._C.FloatTensorBase.sigmoid,
|
||||
"""
|
||||
sigmoid() -> Tensor
|
||||
|
@ -35,18 +35,18 @@ class SetItem(InplaceFunction):
|
||||
self.mark_dirty(i)
|
||||
if value is None:
|
||||
value = self.value
|
||||
i.set_index(self.index, value)
|
||||
i._set_index(self.index, value)
|
||||
return i
|
||||
|
||||
def backward(self, grad_output):
|
||||
if self.value is None:
|
||||
grad_input = grad_output.clone()
|
||||
grad_input.set_index(self.index, 0)
|
||||
grad_input._set_index(self.index, 0)
|
||||
grad_value = grad_output.index(self.index).clone()
|
||||
return grad_input, grad_value
|
||||
else:
|
||||
grad_input = grad_output.clone()
|
||||
grad_input.set_index(self.index, 0)
|
||||
grad_input._set_index(self.index, 0)
|
||||
return grad_input
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@ static PyObject * THPTensor_(storage)(THPTensor *self, PyObject *args)
|
||||
]]
|
||||
|
||||
[[
|
||||
python_name: set_index
|
||||
python_name: _set_index
|
||||
name: THPTensor_(setIndex)
|
||||
only_register: True
|
||||
]]
|
||||
|
Reference in New Issue
Block a user