class_docstr: Implementation of https://arxiv.org/pdf/1612.02295.pdf
class_docstr_tok: ["Implementation","of","https",":","\/\/arxiv.org\/pdf\/1612.02295.pdf"]
code: def cast_types(self, dtype, device):
      self.W.data = c_f.to_device(
          self.W.data, device=device, dtype=dtype
      )
      self.n_range = c_f.to_device(
          self.n_range, device=device, dtype=dtype
      )
      self.margin_choose_n = c_f.to_device(
          self.margin_choose_n, device=device, dtype=dtype
      )
      self.cos_powers = c_f.to_device(
          self.cos_powers, device=device, dtype=dtype
      )
      self.alternating = c_f.to_device(
          self.alternating, device=device, dtype=dtype
      )
  
imports: import math
  import numpy
  import scipy.special
  import torch
  from ..distances import CosineSimilarity
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
  from .base_metric_loss_function import BaseMetricLossFunction
  from .mixins import WeightRegularizerMixin
label_desc: Use image node_id 9 for calling the LargeMarginSoftmaxLoss obj's underlying member method code with example usage: obj.cast_types(dtype, device) without return types