assafshocher / ResizeRight

The correct way to resize images or tensors. For Numpy or Pytorch (differentiable).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make support_sz part of interp_method

shaibagon opened this issue · comments

commented

If I understand correctly, support_sz is determined by interp_method.
In that case, why not make support_sz a function attribute, for example:

@support_sz(4)
def cubic(x):
    fw, to_dtype, eps = set_framework_dependencies(x)
    ...

And in the code, you will only need to pass interp_method and get the support size from interp_method.support_sz
?


implementing the decorator:

def support_sz(sz):
     def wrapper(f):
         f.support_sz = sz
         return f
     return wrapper

Thanks Shai, that's a great advice! fixed.