Skip to content

Add datatype related functions known from other libraries #2095

@brownbaerchen

Description

@brownbaerchen

Related
This is related to the cleanup of the datatype module in #2092.

Feature functionality
Torch has some functions such as torch.is_floating_point that are lacking a heat equivalent, or in this case have a funnily named equivalent (heat.heat_type_is_realfloating).
Similar in numpy, etc.

There are also inconsistencies. For instance, torch.is_complex tests if the datatype is complex, whereas heat.iscomplex is also False if the datatype is complex with zero imaginary part.

The first step is to collect all of these functions. Please post your favorite one below and when somebody gets around to addressing this issue, they will be added. Please post a link to the function that you need to we can make sure the implementation is doing what you want.

For now, I can think of:

  • heat.is_floating_point: alias to heat.heat_type_is_realfloating
  • heat.is_complex: decide how to reconcile with torch version first.
  • I don't think we need heat.isscalar as in numpy.isscalar

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions