class_docstr: Seq2Seq model for sequence processing in O(n log n) time.
docstr: Pad tensor on first dimension to pad_len.
  
  Args:
    tensor: input tensor of shape length >= 2
    pad_len: pad length
  
  Returns:
    tf.Tensor: Padded input tensor.
docstr_tok: ["Pad","tensor","on","first","dimension","to","pad_len",".","Args",":","tensor",":","input","tensor","of","shape","length",">","=","2","pad_len",":","pad","length","Returns",":","tf.Tensor",":","Padded","input","tensor","."]
code: def pad(tensor, pad_len):
      """Pad tensor on first dimension to pad_len.
  
      Args:
        tensor: input tensor of shape length >= 2
        pad_len: pad length
  
      Returns:
        tf.Tensor: Padded input tensor.
      """
  
      assert (
          len(tensor.shape) >= 2
      )  # tensor of shape [batch, length, ...]
      length = tf.shape(tensor)[1]
  
      padding = [[0, 0], [0, pad_len - length]]
      padding += [[0, 0]] * (len(tensor.shape) - 2)
      return tf.pad(tensor, padding)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the ShuffleNetwork obj's underlying member method code with example usage: obj.pad(tensor, pad_len) and returns: tf