sf.math.astensor¶
- math.astensor(dtype=None)¶
Converts a numpy array to a tensor.
- Parameters:
array (
ndarray[Tuple[int,...],Union[TypeVar(R,float16,float32,float64),TypeVar(C,complex64,complex128),TypeVar(Z,int16,int32,int64),TypeVar(N,uint16,uint32,uint64)]]) – The numpy array to convert.dtype – The dtype of the tensor. If
None, the returned tensor is of typefloat.
- Returns:
The tensor with dtype.
code/api/mrmustard.math.astensor
Download Python script
Download Notebook
View on GitHub