resources.wrappers.FileJsonPyTorch.gate-lf-pytorch-json.docs.pythondoc.gatelfpytorchjson.CustomModule.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of learningframework Show documentation
Show all versions of learningframework Show documentation
A GATE plugin that provides many different machine learning
algorithms for a wide range of NLP-related machine learning tasks like
text classification, tagging, or chunking.
gatelfpytorchjson.CustomModule module — GATE LF Pytorch Wrapper (gatelfpytorch) documentation
gatelfpytorchjson.CustomModule module¶
-
class
gatelfpytorchjson.CustomModule.
CustomModule
(config={})[source]¶
Bases: torch.nn.modules.module.Module
-
on_cuda
()[source]¶
Returns true or false depending on if the module is on cuda or not. Unfortunately
there is no API method in PyTorch for this so we get this from the first parameter of the
model and cache it.
NOTE: this must be called outside of the init() method, because the cuda status of the module
gets set by the modelwrapper.