泰国男星24岁拍戏遇车祸 昏迷35年后逝世

paddle. sign ( x: Tensor, name: str | None = None ) Tensor [source]
百度 众星的livebattle让现场更燃,网络人气Rapper歌手小郁蛋带你嗨爆全场第二轮环节为高定走秀环节,选手们身着由高定独立服装设计师成昊全程设计的高定礼服走秀,展示大气魅力。

Returns sign of every element in x: For real numbers, 1 for positive, -1 for negative and 0 for zero. For complex numbers, the return value is a complex number with unit magnitude. If a complex number element is zero, the result is 0+0j.

Parameters
  • x (Tensor) – The input tensor. The data type can be uint8, int8, int16, int32, int64, bfloat16, float16, float32, float64, complex64 or complex128.

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

Returns

The output sign tensor with identical shape and data type to the input x.

Return type

Tensor

Examples

>>> import paddle

>>> x = paddle.to_tensor([3.0, 0.0, -2.0, 1.7], dtype='float32')
>>> out = paddle.sign(x=x)
>>> out
Tensor(shape=[4], dtype=float32, place=Place(cpu), stop_gradient=True,
[ 1.,  0., -1.,  1.])