code: def tf_custom_adaptive_loss(a, b):
      from adaptive import lossfun
  
      shape = a.get_shape().as_list()
      dim = np.prod(shape[1:])
      a = tf.reshape(a, [-1, dim])
      b = tf.reshape(b, [-1, dim])
      loss, _, _ = lossfun(b - a, var_suffix="1")
      return tf.math.reduce_mean(loss)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import tensorflow
  import bz2
  import PIL.Image
  from PIL import ImageFilter
  import numpy
  from keras.models import Model
  from keras.applications.vgg16 import VGG16, preprocess_input
  import keras.backend
  import traceback
  import external.stylegan2.dnnlib.tflib
  from core.landmark_handler import Landmark_Handler
  from core import arcface_handler
label_desc: Use image node_id 2 for calling a global function with example usage: tf_custom_adaptive_loss(a, b) and returns: tf