(sequence_tensor, truncated_length_frames,
                              hparams)
return res
Truncates a NoteSequence to the given length.
Truncates a NoteSequence to the given length.
Truncates a NoteSequence to the given length .
def truncate_note_sequence_op(sequence_tensor, truncated_length_frames,
                              hparams):
  """Truncates a NoteSequence to the given length."""
  def truncate(sequence_tensor, num_frames):
    sequence = music_pb2.NoteSequence.FromString(sequence_tensor)
    num_secs = num_frames / hparams_frames_per_second(hparams)
    return truncate_note_sequence(sequence, num_secs).SerializeToString()
  res = tf.py_func(
      truncate,
      [sequence_tensor, truncated_length_frames],
      tf.string)
  res.set_shape(())
  return res
def truncate_note_sequence_op ( sequence_tensor , truncated_length_frames , hparams ) : def truncate ( sequence_tensor , num_frames ) : sequence = music_pb2 . NoteSequence . FromString ( sequence_tensor ) num_secs = num_frames / hparams_frames_per_second ( hparams ) return truncate_note_sequence ( sequence , num_secs ) . SerializeToString ( ) res = tf . py_func ( truncate , [ sequence_tensor , truncated_length_frames ] , tf . string ) res . set_shape ( ( ) ) return res