r"""Computes the power of one value to another. Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for corresponding elements in `x` and `y`. For example: ```python x = tf.constant([[2, 2], [3, 3]]) y = tf.constant([[8, 16], [2, 3]]) tf.pow(x, y) # [[256, 65536], [
(x, y, name=None)
| 434 | @tf_export("math.pow", "pow") |
| 435 | @dispatch.add_dispatch_support |
| 436 | def pow(x, y, name=None): # pylint: disable=redefined-builtin |
| 437 | r"""Computes the power of one value to another. |
| 438 | |
| 439 | Given a tensor `x` and a tensor `y`, this operation computes \\(x^y\\) for |
| 440 | corresponding elements in `x` and `y`. For example: |
| 441 | |
| 442 | ```python |
| 443 | x = tf.constant([[2, 2], [3, 3]]) |
| 444 | y = tf.constant([[8, 16], [2, 3]]) |
| 445 | tf.pow(x, y) # [[256, 65536], [9, 27]] |
| 446 | ``` |
| 447 | |
| 448 | Args: |
| 449 | x: A `Tensor` of type `float16`, `float32`, `float64`, `int32`, `int64`, |
| 450 | `complex64`, or `complex128`. |
| 451 | y: A `Tensor` of type `float16`, `float32`, `float64`, `int32`, `int64`, |
| 452 | `complex64`, or `complex128`. |
| 453 | name: A name for the operation (optional). |
| 454 | |
| 455 | Returns: |
| 456 | A `Tensor`. |
| 457 | """ |
| 458 | with ops.name_scope(name, "Pow", [x]) as name: |
| 459 | return gen_math_ops._pow(x, y, name=name) |
| 460 | |
| 461 | |
| 462 | # pylint: disable=redefined-builtin,redefined-outer-name |