gin-config icon indicating copy to clipboard operation
gin-config copied to clipboard

Reference static class method in gin config

Open marcoamonteiro opened this issue 1 year ago • 0 comments

In the following example I would like to assign a parameter to the static method ImplClass.foo . The reference @ImplClass.foo is not being resolved properly by gin.

from abc import ABC, abstractmethod
import gin

class BaseClass(ABC):
    @staticmethod
    @abstractmethod
    def foo(a):
        pass

@gin.register()
class ImplClass(BaseClass):
    @gin.register()
    def foo(a):
        print("hello")

marcoamonteiro avatar Jan 30 '24 17:01 marcoamonteiro