code: def affine_grid_3d(affine, size, align_corners):
      B = affine.shape[0]
      D, H, W = size
      grid_t = generate_normalized_grid_3d(B, size, align_corners)
      grid_s = np.matmul(
          grid_t.reshape(B, D * H * W, 4), affine.transpose((0, 2, 1))
      )
      grid_s = grid_s.reshape(B, D, H, W, 3)
      return grid_s.astype(np.float32)
  
imports: from __future__ import division
  from six.moves import range
  import itertools
  import numpy
label_desc: Use image node_id 19 for calling a global function with example usage: affine_grid_3d(affine, size, align_corners) and returns: grid_s