mindspore.ops.zeta

View Source On Gitee
mindspore.ops.zeta(input, other)[source]

Elemental-wise compute the Hurwitz zeta output.

\[\zeta(x, q) = \sum_{k=0}^{\infty} \frac{1}{(k + q)^x}\]

Warning

This is an experimental API that is subject to change or deletion.

Parameters
  • input (Union[Tensor, int, float]) – Input Tensor. Represented as \(x\) in the formula. If it's a Tensor, its dtype must be either float32 or float64.

  • other (Union[Tensor, int, float]) – Input Tensor must have the same dtype as input. Represented as \(q\) in the formula.

Returns

Tensor, The result of Hurwitz zeta function.

Raises
  • TypeError – If neither input nor other is not tensor.

  • TypeError – If dtype of input is neither float32 nor float64.

  • TypeError – If dtype of other is neither float32 nor float64.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([10.]), mindspore.float32)
>>> q = Tensor(np.array([1.]), mindspore.float32)
>>> z = ops.zeta(x, q)
>>> print(z)
[1.0009946]