code: def get_shape(torch_node):
      """Return the output shape of the given Pytorch node."""
      # Extract node output shape from the node string representation
      # This is a hack because there doesn't seem to be an official way to do it.
      # See my quesiton in the PyTorch forum:
      # https://discuss.pytorch.org/t/node-output-shape-from-trace-graph/24351/2
      # TODO: find a better way to extract output shape
      # TODO: Assuming the node has one output. Update if we encounter a multi-output node.
      m = re.match(
          r".*Float\(([\d\s\,]+)\).*", str(next(torch_node.outputs()))
      )
      if m:
          shape = m.group(1)
          shape = shape.split(",")
          shape = tuple(map(int, shape))
      else:
          shape = None
      return shape
  
file_path: tensorwatch/tensorwatch/model_graph/hiddenlayer/pytorch_builder.py
imports: from __future__ import absolute_import, division, print_function
  import re
  from .graph import Graph, Node
  from .None import transforms
  import torch
  from collections import abc
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: get_shape(torch_node) and returns: shape