xlnstorch.LNSTensor.xlns#
- LNSTensor.xlns(dtype=None, array=False, use_xlnsud=False, use_xlnsnpv=False)#
Converts the LNSTensor to an xlns type. If no
dtypeis provided, the most suitable type is inferred.- Parameters:
dtype (type, optional) – The desired xlns type. Must be one of
xl.xlns,xl.xlnsud,xl.xlnsv,xl.xlnsb,xl.xlnsnp,xl.xlnsnpv, orxl.xlnsnpb. IfNone, defaults to the most suitable type based on the base and number of elements.array (bool, optional) – If
True, and dtype isNone, chooses an xlns array type (e.g.xl.xlnsnp) rather than a scalar type (eg.xl.xlns) even if the LNSTensor has only one element. Defaults toFalse.use_xlnsud (bool, optional) – If
True, and dtype isNone, usesxl.xlnsudrather thanxl.xlnswhen inferring the type for an LNSTensor with 1 element and basexl.xlnsB.use_xlnsnpv (bool, optional) – If
True, and dtype isNone, usesxl.xlnsnpvrather thanxl.xlnsnpbwhen inferring the type for an LNSTensor with base having a defined precision.
- Return type:
xlns | xlnsud | xlnsv | xlnsb | xlnsnp | xlnsnpv | xlnsnpb