def _PadLabels3d(logits, labels):
 logits_shape = shapes.tensor_shape(logits)
 labels_shape = shapes.tensor_shape(labels)
 labels = tf.reshape(labels, [(-1), labels_shape[2]])
 labels = _PadLabels2d(logits_shape[2], labels)
 labels = tf.reshape(labels, [labels_shape[0], (-1)])
 labels = _PadLabels2d((logits_shape[1] * logits_shape[2]), labels)
 return tf.reshape(labels, [labels_shape[0], logits_shape[1], logits_shape[2]])

def _PadLabels3d ( logits , labels ) : logits_shape = shapes . tensor_shape ( logits ) labels_shape = shapes . tensor_shape ( labels ) labels = tf . reshape ( labels , [ ( - 1 ) , labels_shape [ 2 ] ] ) labels = _PadLabels2d ( logits_shape [ 2 ] , labels ) labels = tf . reshape ( labels , [ labels_shape [ 0 ] , ( - 1 ) ] ) labels = _PadLabels2d ( ( logits_shape [ 1 ] * logits_shape [ 2 ] ) , labels ) return tf . reshape ( labels , [ labels_shape [ 0 ] , logits_shape [ 1 ] , logits_shape [ 2 ] ] )
pads or slices 3-d labels to match logits .