Is there a better solution to loading custom c++ class other than torch.classes.load_library

I am new to C++ extensions, so far it has been working great but the only thing that annoys me is that we need to hard code torch.classes.load_library(<path-to-dll>) in our program which is not portable. Is there a way to make class extensions the same as functions, i.e. using import <class-name>?