code: def flatten_and_detach_torch_results(torch_results):
      if isinstance(torch_results, (list, tuple)):
          return [x.detach().numpy() for x in _flatten(torch_results)]
      # Do not need to flatten
      return [torch_results.detach().numpy()]
  
imports: import numpy
  import torch
  import torch.nn
  from six import string_types
  from coremltools import TensorType
  from coremltools.converters.mil.testing_reqs import _converter
  from coremltools.models import MLModel
  from coremltools._deps import _IS_MACOS
label_desc: Use image node_id 7 for calling a global function with example usage: flatten_and_detach_torch_results(torch_results) and returns: list, unknown