dpnp.tensor.usm_ndarray_str

dpnp.tensor.usm_ndarray_str(x, line_width=None, edge_items=None, threshold=None, precision=None, floatmode=None, suppress=None, sign=None, numpy=False, separator=' ', prefix='', suffix='')[source]

Returns a string representing the elements of a dpnp.tensor.usm_ndarray.

Parameters:
  • x (usm_ndarray) -- Input array.

  • line_width (int, optional) --

    Number of characters printed per line. Raises TypeError if line_width is not an integer.

    Default: 75.

  • edge_items (int, optional) --

    Number of elements at the beginning and end when the printed array is abbreviated. Raises TypeError if edge_items is not an integer.

    Default: 3.

  • threshold (int, optional) --

    Number of elements that triggers array abbreviation. Raises TypeError if threshold is not an integer.

    Default: 1000.

  • precision (int, optional) --

    Number of digits printed for floating point numbers. Raises TypeError if precision is not an integer.

    Default: 8.

  • floatmode (str, optional) --

    Controls how floating point numbers are interpreted.
    "fixed":

    Always prints exactly precision digits.

    "unique":

    Ignores precision, prints the number of digits necessary to uniquely specify each number.

    "maxprec":

    Prints precision digits or fewer, if fewer will uniquely represent a number.

    "maxprec_equal":

    Prints an equal number of digits for each number. This number is precision digits or fewer, if fewer will uniquely represent each number.

    Raises ValueError if floatmode is not one of fixed, unique, maxprec, or maxprec_equal.

    Default: "maxprec_equal".

  • suppress (bool, optional) --

    If True, numbers equal to zero in the current precision will print as zero.

    Default: False.

  • sign (str, optional) --

    Controls the sign of floating point numbers.
    "-":

    Omit the sign of positive numbers.

    "+":

    Always print the sign of positive numbers.

    " ":

    Always print a whitespace in place of the sign of positive numbers.

    Raises ValueError if sign is not one of "-", "+", or " ".

    Default: "-".

  • numpy (bool, optional) --

    If True, then before other specified print options are set, a dictionary of Numpy's print options will be used to initialize dpnp.tensor's print options.

    Default: False.

  • separator (str, optional) --

    String inserted between elements of the array string.

    Default: " ".

  • prefix (str, optional) --

    String used to determine spacing to the left of the array string.

    Default: "".

  • suffix (str, optional) --

    String that determines length of the last line of the array string.

    Default: "".

Returns:

out -- String representation of input array.

Return type:

str