code: def infer_model_init(self, model, features, mode, params):
      source = self.get_infer_from_input(features, params)
      emb, loss, _, _ = model(source)
      source, emb = self.transfer_embedding(source, emb)
      prediction = {"idx": source, "embedding": emb}
      spec = tf.estimator.EstimatorSpec(
          mode=mode, predictions=prediction
      )
      return spec
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import json
  import numpy
  import tensorflow
  import tf_euler
label_desc: Use image node_id 5 for calling the BaseEstimator obj's underlying member method code with example usage: obj.infer_model_init(model, features, mode, params) and returns: spec