DeepFaceLive/xlib/avecl/_internal/op/cast.py
2021-09-30 18:21:30 +04:00

18 lines
430 B
Python

from ..Tensor import Tensor
from .any_wise import any_wise
def cast(input_t : Tensor, dtype, output_t:Tensor=None) -> Tensor:
"""
cast operator
arguments
input_t
dtype
output_t compute result to this Tensor.
Tensor may be with different shape, but should match total size.
"""
return any_wise('O=I0', input_t, dtype=dtype, output_t=output_t)