code: def _flat_to_shape(tensor, length, shapes):
      tensor_list = []
      total = 0
      for shape in shapes:
          next_total = total + shape.numel()
          # It's important that this be view((...)), not view(...). Else when length=(), shape=() it fails.
          tensor_list.append(
              tensor[..., total:next_total].view((*length, *shape))
          )
          total = next_total
      return tuple(tensor_list)
  
imports: from enum import Enum
  import math
  import numpy
  import torch
  import warnings
  from .event_handling import combine_event_functions
label_desc: Use image node_id 14 for calling a global function with example usage: _flat_to_shape(tensor, length, shapes) and returns: tuple