pytext/torchscript/module.py [71:100]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def __init__(self, model: torch.jit.ScriptModule, tensorizer: ScriptTensorizer):

        super().__init__()
        self.model = model
        self.tensorizer = tensorizer
        self.model_name: str = "*no name*"
        self.model_host = ["cpu"]
        self.model_type = ["nlp"]
        log_class_usage(self.__class__)

    def set_name(self, name: str):
        self.model_name = name

    @torch.jit.script_method
    def get_name(self) -> str:
        return self.model_name

    def set_host(self, hostlist: List[str]):
        self.model_host = hostlist

    @torch.jit.script_method
    def check_host(self, host: str) -> bool:
        return host in self.model_host

    def set_type(self, typelist: List[str]):
        self.model_type = typelist

    @torch.jit.script_method
    def check_type(self, type: str) -> bool:
        return type in self.model_type
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



pytext/torchscript/module.py [1364:1392]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def __init__(self, model: torch.jit.ScriptModule, tensorizer: ScriptTensorizer):
        super().__init__()
        self.model = model
        self.tensorizer = tensorizer
        self.model_name: str = "*no name*"
        self.model_host = ["cpu"]
        self.model_type = ["nlp"]
        log_class_usage(self.__class__)

    def set_name(self, name: str):
        self.model_name = name

    @torch.jit.script_method
    def get_name(self) -> str:
        return self.model_name

    def set_host(self, hostlist: List[str]):
        self.model_host = hostlist

    @torch.jit.script_method
    def check_host(self, host: str) -> bool:
        return host in self.model_host

    def set_type(self, typelist: List[str]):
        self.model_type = typelist

    @torch.jit.script_method
    def check_type(self, type: str) -> bool:
        return type in self.model_type
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



