def __getattr__(self, name): try: return super().__getattribute__(name) except AttributeError as err: if self.opset not in Graph.OPSET_FUNC_MAP or name not in Graph.OPSET_FUNC_MAP[self.opset]: G_LOGGER.error("No function: {:} registered for opset: {:}".format(name, self.opset)) raise err return lambda *args, **kwargs: Graph.OPSET_FUNC_MAP[self.opset][name](self, *args, **kwargs)
def __getattr__(self, name): try: return super().__getattribute__(name) except AttributeError as err: # Opset specific ops always take priority over global ops. if self.opset in Graph.OPSET_FUNC_MAP and name in Graph.OPSET_FUNC_MAP[self.opset]: return lambda *args, **kwargs: Graph.OPSET_FUNC_MAP[self.opset][name](self, *args, **kwargs) if name in Graph.GLOBAL_FUNC_MAP: return lambda *args, **kwargs: Graph.GLOBAL_FUNC_MAP[name](self, *args, **kwargs) G_LOGGER.error("No function: {:} registered for opset: {:}".format(name, self.opset)) raise err