()
return fn
Creates a tf.function for stylization.
Creates a tf.function for stylization.
Creates a tf . function for stylization .
def get_stylize_fn():
  """Creates a tf.function for stylization."""
  input_spec = [
      tf.TensorSpec((None, None, None, 3), tf.float32),
      tf.TensorSpec((None, None, None, 3), tf.float32)
  ]
  predict_feeds = []
  predict_fetches = []

  def umbrella_function(content_img, style_img):
    predict_feeds.extend([content_img, style_img])
    predict_result = build_network(content_img, style_img)
    predict_fetches.extend([
        predict_result,
    ])
    return predict_result

  umbrella_wrapped = tf.compat.v1.wrap_function(umbrella_function, input_spec)
  fn = umbrella_wrapped.prune(predict_feeds, predict_fetches)
  return fn
def get_stylize_fn ( ) : input_spec = [ tf . TensorSpec ( ( None , None , None , 3 ) , tf . float32 ) , tf . TensorSpec ( ( None , None , None , 3 ) , tf . float32 ) ] predict_feeds = [ ] predict_fetches = [ ] def umbrella_function ( content_img , style_img ) : predict_feeds . extend ( [ content_img , style_img ] ) predict_result = build_network ( content_img , style_img ) predict_fetches . extend ( [ predict_result , ] ) return predict_result umbrella_wrapped = tf . compat . v1 . wrap_function ( umbrella_function , input_spec ) fn = umbrella_wrapped . prune ( predict_feeds , predict_fetches ) return fn