股市再遇“黑色星期一”!两市超百只个股跌停
- paddle. gcd ( x: Tensor, y: Tensor, name: str | None = None ) Tensor [source]
-
百度 全新英寸苹果iPad全新英寸苹果iPad苹果英寸iPad(128GB/WLAN)[参考价格]3488元[经销商]●青春畅快精彩:华为M3青春版全新华为平板M3青春版采用简洁纯粹的设计理念,机身边框采用纳米注塑工艺、CNC工艺将金属边框打磨的圆润无比,拥有良好持握感;采用了高端平板使用的一体成型技术,悬浮式设计使得屏幕与金属边框完美贴合,平板正面的传感器开孔采用隐藏式处理,细节方面诚意满满。
Computes the element-wise greatest common divisor (GCD) of input |x| and |y|. Both x and y must have integer types.
Note
gcd(0,0)=0, gcd(0, y)=|y|
If x.shape != y.shape, they must be broadcastable to a common shape (which becomes the shape of the output).
- Parameters
-
x (Tensor) – An N-D Tensor, the data type is int32, int64.
y (Tensor) – An N-D Tensor, the data type is int32, int64.
name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.
- Returns
-
An N-D Tensor, the data type is the same with input.
- Return type
-
out (Tensor)
Examples
>>> import paddle >>> x1 = paddle.to_tensor(12) >>> x2 = paddle.to_tensor(20) >>> paddle.gcd(x1, x2) Tensor(shape=[], dtype=int64, place=Place(cpu), stop_gradient=True, 4) >>> x3 = paddle.arange(6) >>> paddle.gcd(x3, x2) Tensor(shape=[6], dtype=int64, place=Place(cpu), stop_gradient=True, [20, 1 , 2 , 1 , 4 , 5]) >>> x4 = paddle.to_tensor(0) >>> paddle.gcd(x4, x2) Tensor(shape=[], dtype=int64, place=Place(cpu), stop_gradient=True, 20) >>> paddle.gcd(x4, x4) Tensor(shape=[], dtype=int64, place=Place(cpu), stop_gradient=True, 0) >>> x5 = paddle.to_tensor(-20) >>> paddle.gcd(x1, x5) Tensor(shape=[], dtype=int64, place=Place(cpu), stop_gradient=True, 4)