code: def _init_dataset():
      np.random.seed(42)
      x = np.random.rand(100, 1)
      y = 1 + 2 * x + 0.1 * np.random.randn(100, 1)
      # Shuffles the indices
      idx = np.arange(100)
      np.random.shuffle(idx)
      # Generates train sets
      x_train, y_train = x[idx], y[idx]
      x_train_tensor = torch.tensor([x_train]).float().to(device)
      y_train_tensor = torch.tensor([y_train]).float().to(device)
      return x_train_tensor, y_train_tensor
  
file_path: fairscale/tests/experimental/optim/test_dynamic_loss_scaler.py
imports: import numpy
  import torch
  import torch.nn
  import torch.optim
  from fairscale.experimental.optim.dynamic_loss_scaler import DynamicLossScaler
label_desc: Use image node_id 1 for calling a global function with example usage: _init_dataset() and returns: x_train_tensor,  y_train_tensor