耐玩战争策略佳作 XY游戏《三国群雄传》评测

paddle. negative ( x: Tensor, name: str | None = None ) Tensor [source]
百度 该概念要求由4架F-22和1架C-17型机(搭载必要的维护勤务人员及油弹器材等)组成一个快速机动小组,具备24个小时内抵达全球任一前沿基地,72个小时内独立遂行攻击和空中支援任务的能力。

Returns the negated version of the input Tensor. This is used in Tensor.__neg__, applying the unary - operator to the tensor.

\[Out = -X\]
Parameters
  • x (Tensor) – The input tensor. The tensor cannot be of type bool.

  • name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

A tensor with the same shape and data type as the input tensor. The returned tensor

is the negative.

Return type

Tensor

Examples

>>> import paddle
>>> x = paddle.to_tensor([-1, 0, 1])
>>> out = paddle.negative(x)
>>> print(out)
Tensor(shape=[3], dtype=int64, place=Place(cpu), stop_gradient=True,
[1,  0,  -1])