latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.pow
- tensorplay.functional.pow(input, exponent, *, out=None) Tensor[source]
Takes the power of each element in
inputwithexponentand returns a tensor with the result.exponentcan be either a singlefloatnumber or a Tensor with the same number of elements asinput.When
exponentis a scalar value, the operation applied is:When
exponentis a tensor, the operation applied is:When
exponentis a tensor, the shapes ofinputandexponentmust be broadcastable.- Parameters:
- Keyword Arguments:
out (Tensor, optional) – the output tensor.
Example:
>>> a = tensorplay.randn(4) >>> a tensor([ 0.4331, 1.2475, 0.6834, -0.2791]) >>> tensorplay.pow(a, 2) tensor([ 0.1875, 1.5561, 0.4670, 0.0779]) >>> exp = tensorplay.arange(1., 5.) >>> a = tensorplay.arange(1., 5.) >>> a tensor([ 1., 2., 3., 4.]) >>> exp tensor([ 1., 2., 3., 4.]) >>> tensorplay.pow(a, exp) tensor([ 1., 4., 27., 256.])selfis a scalarfloatvalue, andexponentis a tensor. The returned tensoroutis of the same shape asexponentThe operation applied is:
- Parameters:
- Keyword Arguments:
out (Tensor, optional) – the output tensor.
Example:
>>> exp = tensorplay.arange(1., 5.) >>> base = 2 >>> tensorplay.pow(base, exp) tensor([ 2., 4., 8., 16.])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

