Skip to content

Can multipledispatch overload function from external library?  #131

Description

@ImahnShekhzadeh

Hi,

I'd like to overload the function of an external library like this:

from external_libary.class_A import function_A

def function_B(x: float): # overload `function_A(x: int)`
    return int(x) 

A concrete example:

import torch
from torch.distributions import Uniform

def log_prob(value: torch.Tensor, x: torch.Tensor) # overload `Uniform.lob_prob(value: torch.Tensor)`
    return ...

Is this possible in multipledispatch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions