mindquantum.dtype.to_precision_like

View Source On Gitee
mindquantum.dtype.to_precision_like(dtype_src, dtype_des)[source]

Convert dtype_src to same precision as dtype_des.

Parameters
  • dtype_src (mindquantum.dtype) – The data type supported by mindquantum.

  • dtype_des (mindquantum.dtype) – The data type supported by mindquantum.

Examples

>>> from mindquantum import to_precision_like, float32, complex128
>>> to_precision_like(float32, complex128)
>>> mindquantum.float64