code: def output_height_2d(layer, height):
      """Compute the output height of a torch.nn.Conv2d, assuming NCHW format.
  
      This requires knowing the input height. Because NCHW format makes this very
      easy to mix up, this is a seperate function from conv2d_output_height.
  
      It also works on torch.nn.MaxPool2d.
  
      This function implements the formula described in the torch.nn.Conv2d
      documentation:
      https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html
  
      Args:
          layer (torch.nn.Conv2d): The layer to compute output size for.
          height (int): The height of the input image.
  
      Returns:
          int: The height of the output image.
  
      """
      assert isinstance(layer, (torch.nn.Conv2d, torch.nn.MaxPool2d))
      padding = _value_at_axis(layer.padding, 0)
      dilation = _value_at_axis(layer.dilation, 0)
      kernel_size = _value_at_axis(layer.kernel_size, 0)
      stride = _value_at_axis(layer.stride, 0)
      return math.floor(
          (height + 2 * padding - dilation * (kernel_size - 1) - 1)
          / stride
          + 1
      )
  
imports: import copy
  import math
  import warnings
  import torch
  from torch import nn
  import torch.nn.functional
label_desc: Use image node_id 19 for calling a global function with example usage: output_height_2d(layer, height) and returns: math