class_docstr: Used to handle transforms with `event_dim > 1` until we have a Reshape transform in PyTorch
class_docstr_tok: ["Used","to","handle","transforms","with","`","event_dim",">","1","`","until","we","have","a","Reshape","transform","in","PyTorch"]
code: def __init__(self, transform, input_shape):
      super().__init__(cache_size=1)
      assert transform.domain.event_dim == len(input_shape)
      output_shape = transform.forward_shape(input_shape)
      assert len(output_shape) >= transform.codomain.event_dim
      output_shape = output_shape[
          len(output_shape) - transform.codomain.event_dim :
      ]
  
      self.transform = transform
      self.input_shape = input_shape
      self.output_shape = output_shape
  
imports: import operator
  from functools import partial, reduce
  from unittest import TestCase
  import pytest
  import torch
  import pyro.distributions
  import pyro.distributions.transforms
  from pyro.distributions import constraints
  from tests.common import assert_close
label_desc: Use image node_id 1 to create a new Flatten object from inherited base classes: dist with example: obj = Flatten(transform, input_shape)