class_docstr: `FeatureConnector` for voxel grids.
  
  During `_generate_examples`, the feature connector accepts as input any of:
  
    * `dict`: dictionary containing the path to a {.mat} file and the key under
    which the voxel grid is accessible inside the file.
    Structure of the dictionary:
      {
      'path': 'path/to/file.mat',
      'key': 'foo'
      }
  
    * `np.ndarray`: float32 numpy array of shape [X,Y,Z] representing the
    voxel grid.
  
  Output:
    A float32 Tensor with shape [X,Y,Z] containing the voxel occupancies.
code: def encode_example(self, example_data):
      # Path to .mat file
      if isinstance(example_data, dict):
          if not all(key in example_data for key in ["path", "key"]):
              raise ValueError(
                  f"Missing keys in provided dictionary! Expecting 'path'"
                  f" and 'key', but {example_data.keys()} were given."
              )
  
          if not os.path.exists(example_data["path"]):
              raise FileNotFoundError(
                  f"File `{example_data['path']}` does not exist."
              )
  
          with tf.io.gfile.GFile(
              example_data["path"], "rb"
          ) as mat_file:
              voxel_mat = sio.loadmat(mat_file)
  
          if example_data["key"] not in voxel_mat:
              raise ValueError(
                  f"Key `{example_data['key']}` not found in .mat file. "
                  f"Available keys in file: {voxel_mat.keys()}"
              )
  
          voxel_grid = voxel_mat[example_data["key"]].astype(np.float32)
  
      else:
          if example_data.ndim != 3:
              raise ValueError("Only 3D Voxel Grids are supported.")
  
          voxel_grid = example_data
  
      return super(VoxelGrid, self).encode_example(voxel_grid)
  
file_path: graphics/tensorflow_graphics/datasets/features/voxel_feature.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  from scipy import io
  import tensorflow
  from tensorflow_datasets import features
label_desc: Use image node_id 2 for calling the VoxelGrid obj's underlying member method code with example usage: obj.encode_example(example_data) and returns: super