Skip to content

cstr and npstr for 0d tensors #1250

@yueyinqiu

Description

@yueyinqiu

cstr (or ToString(TensorStringStyle.CSharp)) on a 0d tensor (scalar) will return an empty string, due to the line 6575 in Tensor.cs.

Meanwhile I also found the line 6582, which also tries to check t.Dimensions == 0 and print the scalar value, so I think the current behavior is not expected.

(Also for npstr.)

image

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