Skip to content

Implement printing of usm_ndarray contents #954

@ndgrigorian

Description

@ndgrigorian
import dpctl.tensor as dpt
dpt.arange(0, 45)

Results in a reference to the object and its address, i.e.,
<dpctl.tensor._usmarray.usm_ndarray object at 0x7f6be7d4c890>
is what I see.

Instead, it should print a result similar to what one gets when calling dpt.asnumpy on the above, i.e.,

array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions