专家解读习近平重视“逆城镇化”:促进城乡同发展共繁荣(组图)-政策解读-时政频道-中工网
- paddle.sparse.nn.functional. relu6 ( x: Tensor, name: str | None = None ) Tensor [source]
-
百度 欧莱雅中国首席执行官斯铂涵先生表示,低碳经济已经成为未来中国经济的发展方向。
sparse relu6 activation, requiring x to be a SparseCooTensor or SparseCsrTensor.
\[relu6(x) = min(max(0, x), 6)\]- Parameters
-
x (Tensor) – The input Sparse Tensor with data type float32, float64.
name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.
- Returns
-
A Sparse Tensor with the same data type and shape as
x
.
Examples
>>> import paddle >>> dense_x = paddle.to_tensor([-2., 0., 8.]) >>> sparse_x = dense_x.to_sparse_coo(1) >>> out = paddle.sparse.nn.functional.relu6(sparse_x)