class_docstr: Discrete bottleneck class.
class_docstr_tok: ["Discrete","bottleneck","class","."]
docstr: Slice encoder hidden state into block_dim.
  
  Args:
      x: Encoder hidden state of shape [-1, hidden_size].
  
  Returns:
      Sliced states of shape [-1, num_blocks, block_dim].
docstr_tok: ["Slice","encoder","hidden","state","into","block_dim",".","Args",":","x",":","Encoder","hidden","state","of","shape","[","-1",",","hidden_size","]",".","Returns",":","Sliced","states","of","shape","[","-1",",","num_blocks",",","block_dim","]","."]
code: def slice_hidden(self, x):
      """Slice encoder hidden state into block_dim.
  
      Args:
          x: Encoder hidden state of shape [-1, hidden_size].
  
      Returns:
          Sliced states of shape [-1, num_blocks, block_dim].
      """
      x_sliced = tf.reshape(
          x, shape=[-1, self.hparams.num_blocks, self.hparams.block_dim]
      )
      return x_sliced
  
file_path: tensor2tensor/tensor2tensor/layers/vq_discrete.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from functools import partial
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 2 for calling the DiscreteBottleneck obj's underlying member method code with example usage: obj.slice_hidden(x) and returns: x_sliced