gatelfpytorchjson.embeddingsmodule module

class gatelfpytorchjson.embeddingsmodule.EmbeddingsModule(vocab, cuda=None, emb_dims=None)[source]

Bases: torch.nn.modules.module.Module

forward(batch)[source]
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.