Skip to content

Unexpected dtype returned when operating with Float32 / ComplexFloat32 tensors and numpy scalars #692

@Chan-Sing-Hong

Description

@Chan-Sing-Hong

Description
Unexpected dtype are returned when performing operations involving Float, ComplexFloat Tensors and numpy.float32, numpy.complex64.

Expected Behavior
cytnx.Type.Float / numpy.float32 -> cytnx.Float
cytnx.Type.ComplexFloat / numpy.float32 -> cytnx.Type.ComplexFloat
cytnx.Type.ComplexFloat / numpy.complex64 -> cytnx.Type.ComplexFloat

Actual Behavior
However, all of the above cases currently return ComplexDouble (Complex Float64).

A notebook demonstrating the issue is attached:
Float32_issue.ipynb

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions