code: def convert_tensors_recursively_to(val, *args, **kwargs):
      """Applies `.to(*args, **kwargs)` to each tensor inside val tree. Other values remain the same."""
      if isinstance(val, torch.Tensor):
          return val.to(*args, **kwargs)
  
      if isinstance(val, (tuple, list)):
          return type(val)(
              convert_tensors_recursively_to(item, *args, **kwargs)
              for item in val
          )
  
      return val
  
imports: import argparse
  from collections import OrderedDict
  from copy import deepcopy
  import logging
  import operator
  import random
  import numpy
  import torch
  import torch.nn
  import torch.backends.cudnn
  import yaml
  import inspect
label_desc: Use image node_id 50 for calling a global function with example usage: convert_tensors_recursively_to(val) and returns: val, val, type