Returns dummy agent class for if PyTorch etc. is not installed.

def _agent_import_failed(trace):
    """Returns dummy agent class for if PyTorch etc. is not installed."""

    class _AgentImportFailed(Trainer):
        _name = "AgentImportFailed"
        _default_config = with_common_config({})

        def _setup(self, config):
            raise ImportError(trace)

    return _AgentImportFailed