code: def test_multi_inputs_and_outputs(self):
      x1 = np.random.random((34, 1))
      x2 = np.random.random((34, 2))
      y1 = np.random.random((34, 3))
      y2 = np.random.random((34, 4))
      sw = np.random.random((34,))
      adapter = array_data_adapter.ArrayDataAdapter(
          x={"x1": x1, "x2": x2},
          y=[y1, y2],
          sample_weight=sw,
          batch_size=16,
          steps=None,
          shuffle=False,
      )
      gen = adapter.get_numpy_iterator()
      for i, batch in enumerate(gen):
          self.assertEqual(len(batch), 3)
          bx, by, bw = batch
          self.assertIsInstance(bx, dict)
          # NOTE: the y list was converted to a tuple for tf.data
          # compatibility.
          self.assertIsInstance(by, tuple)
          self.assertIsInstance(bw, tuple)
  
          self.assertIsInstance(bx["x1"], np.ndarray)
          self.assertIsInstance(bx["x2"], np.ndarray)
          self.assertIsInstance(by[0], np.ndarray)
          self.assertIsInstance(by[1], np.ndarray)
          self.assertIsInstance(bw[0], np.ndarray)
          self.assertIsInstance(bw[1], np.ndarray)
  
          self.assertEqual(bx["x1"].dtype, by[0].dtype)
          self.assertEqual(bx["x1"].dtype, backend.floatx())
          if i < 2:
              self.assertEqual(bx["x1"].shape, (16, 1))
              self.assertEqual(bx["x2"].shape, (16, 2))
              self.assertEqual(by[0].shape, (16, 3))
              self.assertEqual(by[1].shape, (16, 4))
              self.assertEqual(bw[0].shape, (16,))
              self.assertEqual(bw[1].shape, (16,))
          else:
              self.assertEqual(bx["x1"].shape, (2, 1))
              self.assertEqual(by[0].shape, (2, 3))
              self.assertEqual(bw[0].shape, (2,))
              self.assertEqual(bw[1].shape, (2,))
      ds = adapter.get_tf_dataset()
      for i, batch in enumerate(ds):
          self.assertEqual(len(batch), 3)
          bx, by, bw = batch
          self.assertIsInstance(bx, dict)
          # NOTE: the y list was converted to a tuple for tf.data
          # compatibility.
          self.assertIsInstance(by, tuple)
          self.assertIsInstance(bw, tuple)
  
          self.assertIsInstance(bx["x1"], tf.Tensor)
          self.assertIsInstance(bx["x2"], tf.Tensor)
          self.assertIsInstance(by[0], tf.Tensor)
          self.assertIsInstance(by[1], tf.Tensor)
          self.assertIsInstance(bw[0], tf.Tensor)
          self.assertIsInstance(bw[1], tf.Tensor)
  
          self.assertEqual(bx["x1"].dtype, by[0].dtype)
          self.assertEqual(bx["x1"].dtype, backend.floatx())
          if i < 2:
              self.assertEqual(tuple(bx["x1"].shape), (16, 1))
              self.assertEqual(tuple(bx["x2"].shape), (16, 2))
              self.assertEqual(tuple(by[0].shape), (16, 3))
              self.assertEqual(tuple(by[1].shape), (16, 4))
              self.assertEqual(tuple(bw[0].shape), (16,))
              self.assertEqual(tuple(bw[1].shape), (16,))
          else:
              self.assertEqual(tuple(bx["x1"].shape), (2, 1))
              self.assertEqual(tuple(by[0].shape), (2, 3))
              self.assertEqual(tuple(bw[0].shape), (2,))
              self.assertEqual(tuple(bw[1].shape), (2,))
  
file_path: keras/keras/trainers/data_adapters/array_data_adapter_test.py
imports: import numpy
  import pandas
  import pytest
  import tensorflow
  from absl.testing import parameterized
  from keras import backend
  from keras import testing
  from keras.trainers.data_adapters import array_data_adapter
label_desc: Use image node_id 3 for calling the TestArrayDataAdapter obj's underlying member method code with example usage: obj.test_multi_inputs_and_outputs() without return types