def _pack_sequences_k(inputs, targets, input_max_length, target_max_length):
  """Wrapper for pack_sequences_k with same interface as pack_sequences_2."""
  inputs = tf.convert_to_tensor(inputs, tf.int32)
  targets = tf.convert_to_tensor(targets, tf.int32)
  input_max_length = tf.convert_to_tensor(input_max_length, dtype=tf.int32)
  target_max_length = tf.convert_to_tensor(target_max_length, dtype=tf.int32)
  (packed, segmentation, position) = pack_sequences_ops.pack_sequences_k(
      [inputs, targets], [input_max_length, target_max_length])
  (inputs_packed, targets_packed) = packed
  (inputs_segmentation, targets_segmentation) = segmentation
  (inputs_position, targets_position) = position
  return (inputs_packed, inputs_segmentation, inputs_position, targets_packed,
          targets_segmentation, targets_position)
Wrapper for pack_sequences_k with same interface as pack_sequences_2.
tensor2tensor/data_generators/ops/pack_sequences_ops_test.py