docstr: Converts encoder models to device specified (CPU/GPU)
  
  Transformers are LARGE models, please run on GPU for fastest implementation.
docstr_tok: ["Converts","encoder","models","to","device","specified","(","CPU\/GPU",")","Transformers","are","LARGE","models",",","please","run","on","GPU","for","fastest","implementation","."]
code: def to(self, device, available_devices):
      """
      Converts encoder models to device specified (CPU/GPU)
  
      Transformers are LARGE models, please run on GPU for fastest implementation.
      """  # noqa
      for v in vars(self):
          attr = getattr(self, v)
          if isinstance(attr, torch.nn.Module):
              attr.to(device)
      return self
  
imports: import os
  import time
  from typing import Iterable
  from collections import deque
  import numpy
  import torch
  from torch.utils.data import DataLoader
  import pandas
  from type_infer.dtype import dtype
  from transformers import DistilBertModel, DistilBertForSequenceClassification, DistilBertTokenizerFast, AdamW, get_linear_schedule_with_warmup
  from sklearn.model_selection import train_test_split
  from lightwood.encoder.text.helpers.pretrained_helpers import TextEmbed
  from lightwood.helpers.device import get_device_from_name
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.log import log
  from lightwood.helpers.torch import LightwoodAutocast
  from lightwood.helpers.general import is_none
label_desc: Use image node_id 8 for calling the PretrainedLangEncoder obj's underlying member method code with example usage: obj.to(device, available_devices) and returns: self