code: def bytenet_internal(inputs, targets, hparams):
      """ByteNet, main step used for training."""
      with tf.variable_scope("bytenet"):
          # Flatten inputs and extend length by 50%.
          inputs = tf.expand_dims(
              common_layers.flatten4d3d(inputs), axis=2
          )
          extend_length = tf.to_int32(
              0.5 * tf.to_float(tf.shape(inputs)[1])
          )
          inputs_shape = inputs.shape.as_list()
          inputs = tf.pad(
              inputs, [[0, 0], [0, extend_length], [0, 0], [0, 0]]
          )
          inputs_shape[1] = None
          inputs.set_shape(
              inputs_shape
          )  # Don't lose the other shapes when padding.
          # Pad inputs and targets to be the same length, divisible by 50.
          inputs, targets = common_layers.pad_to_same_length(
              inputs, targets, final_length_divisible_by=50
          )
          final_encoder = residual_dilated_conv(
              inputs,
              hparams.num_block_repeat,
              "SAME",
              "encoder",
              hparams,
          )
  
          shifted_targets = common_layers.shift_right(targets)
          kernel = (hparams.kernel_height, hparams.kernel_width)
          decoder_start = common_layers.conv_block(
              tf.concat([final_encoder, shifted_targets], axis=3),
              hparams.hidden_size,
              [((1, 1), kernel)],
              padding="LEFT",
          )
  
          return residual_dilated_conv(
              decoder_start,
              hparams.num_block_repeat,
              "LEFT",
              "decoder",
              hparams,
          )
  
file_path: tensor2tensor/tensor2tensor/models/bytenet.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from six.moves import range
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: bytenet_internal(inputs, targets, hparams) and returns: residual_dilated_conv