(_target_: Callable, _partial_: bool, *args, **kwargs)
Call target (type) with args and kwargs.
Call target (type) with args and kwargs.
Call target ( type ) with args and kwargs .
def _call_target(_target_: Callable, _partial_: bool, *args, **kwargs) -> Any:  # type: ignore
    """Call target (type) with args and kwargs."""
    try:
        args, kwargs = _extract_pos_args(*args, **kwargs)
        # detaching configs from parent.
        # At this time, everything is resolved and the parent link can cause
        # issues when serializing objects in some scenarios.
        for arg in args:
            if OmegaConf.is_config(arg):
                arg._set_parent(None)
        for v in kwargs.values():
            if OmegaConf.is_config(v):
                v._set_parent(None)
    except Exception as e:
        raise type(e)(
            f"Error instantiating '{_convert_target_to_string(_target_)}' : {e}"
        ).with_traceback(sys.exc_info()[2])

    try:
        if _partial_:
            return functools.partial(_target_, *args, **kwargs)
        return _target_(*args, **kwargs)
    except Exception as e:
        raise InstantiationException(
            f"Error instantiating '{_convert_target_to_string(_target_)}' : {repr(e)}"
        ) from e
def _call_target ( _target_ : Callable , _partial_ : bool , * args , * * kwargs ) -> Any : # type: ignore try : args , kwargs = _extract_pos_args ( * args , * * kwargs ) # detaching configs from parent. # At this time, everything is resolved and the parent link can cause # issues when serializing objects in some scenarios. for arg in args : if OmegaConf . is_config ( arg ) : arg . _set_parent ( None ) for v in kwargs . values ( ) : if OmegaConf . is_config ( v ) : v . _set_parent ( None ) except Exception as e : raise type ( e ) ( f"Error instantiating '{_convert_target_to_string(_target_)}' : {e}" ) . with_traceback ( sys . exc_info ( ) [ 2 ] ) try : if _partial_ : return functools . partial ( _target_ , * args , * * kwargs ) return _target_ ( * args , * * kwargs ) except Exception as e : raise InstantiationException ( f"Error instantiating '{_convert_target_to_string(_target_)}' : {repr(e)}" ) from e