Overload functions
See original GitHub issueOpening this to discussion about having a kornia.overload
to support api duality
Based on @shijianjian proposal:
I thinking of something like:
from typing import overload
class A():
@overload
def generate_parameters(self, batchsize: Tuple[...]) -> Dict:
...
@overload
def generate_parameters(self, input: Tensor, mask: Tensor) -> Dict:
...
Not sure how would PyTorch like this grammar.
_Originally posted by @shijianjian in https://github.com/kornia/kornia/issues/2050#issuecomment-1336374972_
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Function overloading - Wikipedia
In some programming languages, function overloading or method overloading is the ability to create multiple functions of the same name with different ......
Read more >Function Overloading | Microsoft Learn
C++ lets you specify more than one function of the same name in the same scope. These functions are called overloaded functions, ...
Read more >C++ Function Overloading (With Examples) - Programiz
In this tutorial, we will learn about function overloading in C++ with examples. Two or more functions having the same name but different...
Read more >Overloading functions (C++ only) - IBM
You overload a function name f by declaring more than one function with the name f in the same scope. The declarations of...
Read more >6.4. Overloaded Functions
Overloaded functions describe when programmers create two or more functions with the same name in the same scope. The procedural programming model places ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would love to see something like below (or a variant) to support research/production use cases:
/cc discussed at some point with @ducha-aiki
@johnnv1 @shijianjian i found this interesting article https://martinheinz.dev/blog/50