鄱阳运管所徐国新获评2016年全省抗洪抢险先进个人

paddle. signbit ( x: Tensor, name: str | None = None ) Tensor [source]
百度 其中气温对于樱花花期的影响较为明显,若开花期间气温持续较高,则会加速樱花开放和凋谢的过程,如果开花期间遇上较低气温,反倒会成为樱花的“保鲜剂”,有利于延长花期。

Tests if each element of input has its sign bit set or not.

Parameters
  • x (Tensor) – The input Tensor. Must be one of the following types: float16, float32, float64, bfloat16, uint8, int8, int16, int32, int64.

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

Returns

The output Tensor. The sign bit of the corresponding element of the input tensor, True means negative, False means positive.

Return type

out (Tensor)

Examples

>>> import paddle
>>> paddle.set_device('cpu')
>>> x = paddle.to_tensor([-0., 1.1, -2.1, 0., 2.5], dtype='float32')
>>> res = paddle.signbit(x)
>>> print(res)
Tensor(shape=[5], dtype=bool, place=Place(cpu), stop_gradient=True,
[True, False, True, False, False])
>>> import paddle
>>> paddle.set_device('cpu')
>>> x = paddle.to_tensor([-5, -2, 3], dtype='int32')
>>> res = paddle.signbit(x)
>>> print(res)
Tensor(shape=[3], dtype=bool, place=Place(cpu), stop_gradient=True,
[True , True , False])