xlnstorch.format_lnstensor_operands

xlnstorch.format_lnstensor_operands#

xlnstorch.format_lnstensor_operands(*operands, base=None)#

Converts a variable number of operands to LNSTensor objects, aligning all operands to the base of the first operand that is an LNSTensor.

Parameters:
  • operands (Any) – Variable number of operands, which can be LNSTensor objects or other array-like objects that can be converted to LNSTensor.

  • base (torch.Tensor, optional) – The base to force conversion to if supplied.

Returns:

A tuple of LNSTensor objects with their bases aligned to the base of the first LNSTensor operand. If no LNSTensor is found, all operands are converted to LNSTensors with the default base.

Return type:

Tuple[LNSTensor, …]