ITADN

Can `multipledispatch` overload function from external library?

#131OpenImahnShekhzadeh 创建于 2023-09-08
I
ImahnShekhzadehcommented
Hi, I'd like to overload the function of an external library like this: ```python from external_libary.class_A import function_A def function_B(x: float): # overload `function_A(x: int)` return int(x) ``` A concrete example: ```python 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`?
0 条评论