class_docstr: Improved version over VectorQuantizer, can be used as a drop-in replacement. Mostly avoids costly matrix
  multiplications and allows for post-hoc remapping of indices.
class_docstr_tok: ["Improved","version","over","VectorQuantizer",",","can","be","used","as","a","drop-in","replacement",".","Mostly","avoids","costly","matrix","multiplications","and","allows","for","post-hoc","remapping","of","indices","."]
code: def unmap_to_all(self, inds):
      ishape = inds.shape
      assert len(ishape) > 1
      inds = inds.reshape([ishape[0], -1])
      used = self.used
      if self.re_embed > self.used.shape[0]:  # extra token
          inds[inds >= self.used.shape[0]] = 0  # simply set to zero
      back = paddle.gather(
          used[None, :][inds.shape[0] * [0], :], inds, axis=1
      )
      return back.reshape(ishape)
  
imports: import numpy
  import paddle
  import paddle.nn
  from ..configuration_utils import ConfigMixin
  from ..configuration_utils import register_to_config
  from .unet_blocks import get_down_block
  from .unet_blocks import get_up_block
  from .unet_blocks import UNetMidBlock2D
label_desc: Use image node_id 3 for calling the VectorQuantizer obj's underlying member method code with example usage: obj.unmap_to_all(inds) and returns: back