code: def get_signature_def(model, use_tf_sampling):
      """Creates a signature def for the SavedModel."""
      if use_tf_sampling:
          return (
              tf.saved_model.signature_def_utils.predict_signature_def(
                  inputs={
                      "pianorolls": model.inputs["pianorolls"],
                  },
                  outputs={
                      "predictions": tf.cast(model.samples, tf.bool),
                  },
              )
          )
      return tf.saved_model.signature_def_utils.predict_signature_def(
          inputs={
              "pianorolls": model.model.pianorolls,
              "masks": model.model.masks,
              "lengths": model.model.lengths,
          },
          outputs={"predictions": model.model.predictions},
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: get_signature_def(model, use_tf_sampling) and returns: tf, tf