code: def test_StackDenseFixedSizeArray(self) -> None:
      # happy path: value is type Tensor; check cast to float
      value = torch.eye(4).to(dtype=torch.int)  # start as int
      data = {"a": value}
      # pyre-fixme[6]: For 1st param expected `List[str]` but got `_dict_keys[str,
      #  typing.Any]`.
      out = transforms.StackDenseFixedSizeArray(data.keys(), size=4)(
          data
      )
      expected = {"a": value.to(dtype=torch.float)}
      self.assertDictOfTensorEqual(out, expected)
      self.assertTrue(
          out["a"].dtype == torch.float, msg="dtype != float"
      )
  
      # happy path: value is list w/ elements type Tuple[Tensor, Tensor]
      presence = torch.tensor([[1, 1, 1], [1, 1, 1]])
      data = {
          "a": [
              (torch.tensor([[0, 0, 0], [1, 1, 1]]), presence),
              (torch.tensor([[2, 2, 2], [3, 3, 3]]), presence),
          ],
          "b": [
              (torch.tensor([[3, 3, 3], [2, 2, 2]]), presence),
              (torch.tensor([[1, 1, 1], [0, 0, 0]]), presence),
          ],
      }
      # pyre-fixme[6]: For 1st param expected `List[str]` but got `_dict_keys[str,
      #  List[Tuple[typing.Any, typing.Any]]]`.
      out = transforms.StackDenseFixedSizeArray(data.keys(), size=3)(
          data
      )
      expected = {
          "a": torch.tile(
              torch.arange(4).view(-1, 1).to(dtype=torch.float), (1, 3)
          ),
          "b": torch.tile(
              torch.arange(4)
              .flip(dims=(0,))
              .view(-1, 1)
              .to(dtype=torch.float),
              (1, 3),
          ),
      }
      self.assertDictOfTensorEqual(out, expected)
  
      # raise for tensor wrong shape
      with self.assertRaisesRegex(ValueError, "Wrong shape"):
          sdf = transforms.StackDenseFixedSizeArray(["a"], size=3)
          sdf({"a": torch.ones(2)})
  
      # raise for tensor wrong ndim
      with self.assertRaisesRegex(ValueError, "Wrong shape"):
          sdf = transforms.StackDenseFixedSizeArray(["a"], size=2)
          sdf({"a": torch.zeros(2, 2, 2)})
  
imports: import os
  import unittest
  from copy import deepcopy
  from typing import List
  from unittest.mock import Mock, patch
  import numpy
  import reagent.core.types
  import torch
  from reagent.preprocessing import transforms
  from reagent.preprocessing.types import InputColumn
label_desc: Use image node_id 10 for calling the TestTransforms obj's underlying member method code with example usage: obj.test_StackDenseFixedSizeArray() without return types