Skip to content

Any ways to support torch functions #546

@ioangatop

Description

@ioangatop

🚀 Feature request

Hi! I would like to use torch functions straight from the yaml file, for example:

class_path: SomeClass
init_args:
  process:
    class_path: torch.argmax
    init_args:
      dim: 1

However, I have had time to succeed, as the typing check fails, as for example the following:

class SomeClass:
  def __init__(self, process: Callable[..., torch.Tensor]) -> None:
    ...

The way around is to wrap them around callable classes, but it would be great to support them, like the dot imports for the torch optimizes, so I dont have to duplicate them or clear a wrapper class

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions