Skip to content

Parse callables (functions, methods) similarly to objects #5852

Closed
@ibro45

Description

@ibro45

Is your feature request related to a problem? Please describe.
Support for functions/methods in config by making Monai call them instead of attempting to instantiate them.

calculate:
    _target_: "math.isclose"
    a: 0.001
    b: 0.002

Describe the solution you'd like
A solution like Hydra's (https://hydra.cc/docs/advanced/instantiate_objects/overview/) that can both instantiate or call would be perfect.

Describe alternatives you've considered
None

Additional context
While you could do calculate: "$math.isclose(0.001, 0.002)", it does not allow argument overriding from CLI.

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