tilus.Script.print_tensor

tilus.Script.print_tensor

Script.print_tensor(msg, tensor, fmt=None)[source]

Print a tensor with a message.

This instruction prints the contents of a tensor along with a message. The msg parameter is a string that will be printed before the tensor contents.

The fmt parameter is an optional format string that specifies how the tensor elements should be formatted when printed.

Parameters:
  • msg (str) – The message to print before the tensor contents.

  • tensor (Tensor) – The tensor to print. It can be any tensor type, including RegisterTensor, GlobalTensor, or SharedTensor.

  • fmt (str) –

    The format string to use when printing the tensor elements. If not provided, a default format will be used. It should be a valid format specifier in C-style format used in printf function. The default format is determined according to the data type of the tensor elements.

    • int32: “%5d”

    • float16: “%5.2f”

    • float32: “%6.3f”

    • boolean: “%1d”

Return type:

None