I have a jitclass that inherits from a non jitclass. I was wondering if the child jitclass’s methods that are defined in the parent class would be automatically jit compiled (even though the parent class is not a jitclass).
Here is an example:
class ParentClass:
def __init__(self):
pass
def some_method(self, first_input: types.int64, second_input: types.int64) -> types.int64:
return first_input + second_input
@jitclass
class ChildClass(ParentClass):
def __init__(self):
pass
child_class = ChildClass()
result = child_class.some_method(10, 5)
Would the call of child_class.some_method
use a jitted version of the some_method
method?
I have added a custom compiler that prints whenever a function is being compiled. When I run some_method from the child_class, the logs suggest that indeed the method is being jit compiled. Therefor, my answer would be yes, even if the parent class is not jitted, inheriting from it in a jitted class will automatically jit all its method.
Could anyone confirm this? And maybe add a little bit of explanation on what is happening under the hood?
Thanks