xlnstorch.LNSTensor.xlns

Contents

xlnstorch.LNSTensor.xlns#

LNSTensor.xlns(dtype=None, array=False, use_xlnsud=False, use_xlnsnpv=False)#

Converts the LNSTensor to an xlns type. If no dtype is 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, or xl.xlnsnpb. If None, defaults to the most suitable type based on the base and number of elements.

  • array (bool, optional) – If True, and dtype is None, 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 to False.

  • use_xlnsud (bool, optional) – If True, and dtype is None, uses xl.xlnsud rather than xl.xlns when inferring the type for an LNSTensor with 1 element and base xl.xlnsB.

  • use_xlnsnpv (bool, optional) – If True, and dtype is None, uses xl.xlnsnpv rather than xl.xlnsnpb when inferring the type for an LNSTensor with base having a defined precision.

Return type:

xlns | xlnsud | xlnsv | xlnsb | xlnsnp | xlnsnpv | xlnsnpb