tf.pow.md 675 字节
Newer Older
Z
zhoukunsheng 已提交
1
## tf.pow
Z
zhoukunsheng 已提交
2

Z
zhoukunsheng 已提交
3
### [tf.pow](https://www.tensorflow.org/api_docs/python/tf/math/pow)
Z
zhoukunsheng 已提交
4 5 6 7 8 9 10 11 12

```python
tf.math.pow(
    x,
    y,
    name=None
)
```

J
jiangjiajun 已提交
13
### [paddle.fluid.layers.pow](http://paddlepaddle.org/documentation/docs/zh/1.4/api_cn/layers_cn.html#pow)
Z
zhoukunsheng 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26

```python
paddle.fluid.layers.pow(
    x, 
    factor=1.0, 
    name=None
)
```

### 功能差异

#### 参数类型

Z
zhoukunsheng 已提交
27
TensorFlow:`x``y`为shape相同的tensor,执行element-wise求幂操作;  
Z
zhoukunsheng 已提交
28 29 30 31 32 33 34 35 36

PaddlePaddle:`x`为tensor,`factor`为浮点数,返回值为`x`每个元素执行按照`factor`执行求幂操作得到的tensor。

### 代码示例
```
# x为张量 [2, 3]
out = fluid.layers.pow(x, 2.0) # [4,9]

```