docstr: Create a TFNet from an a session and the inputs and outpus endpoints
  of the TensorFlow graph.
  :param sess: the TensorFlow session contain all the variables
  :param inputs: a list of TensorFlow Tensor represents the input endpoints
  of the TensorFlow graph
  :param outputs: a list of TensorFlow Tensor represents the output endpoints
  of the TensorFlow graph
  :param tf_session_config: an optional tf.ConfigProto object to
                 set the session config in java side.
                 This config does not necessarily be the same with your current session.
                 E.g. sess_config = tf.ConfigProto(inter_op_parallelism_threads=1,
                                                   intra_op_parallelism_threads=1)
                      net = TFNet.from_session(sess, inputs, outputs, sess_config)
  :return a TFNet
docstr_tok: ["Create","a","TFNet","from","an","a","session","and","the","inputs","and","outpus","endpoints","of","the","TensorFlow","graph",".",":","param","sess",":","the","TensorFlow","session","contain","all","the","variables",":","param","inputs",":","a","list","of","TensorFlow","Tensor","represents","the","input","endpoints","of","the","TensorFlow","graph",":","param","outputs",":","a","list","of","TensorFlow","Tensor","represents","the","output","endpoints","of","the","TensorFlow","graph",":","param","tf_session_config",":","an","optional","tf.ConfigProto","object","to","set","the","session","config","in","java","side",".","This","config","does","not","necessarily","be","the","same","with","your","current","session",".","E.g",".","sess_config","=","tf.ConfigProto","(","inter_op_parallelism_threads=1",",","intra_op_parallelism_threads=1",")","net","=","TFNet.from_session","(","sess",",","inputs",",","outputs",",","sess_config",")",":","return","a","TFNet"]
code: def from_session(
      sess,
      inputs,
      outputs,
      generate_backward=False,
      allow_non_differentiable_input=True,
      tf_session_config=None,
  ):
      """
      Create a TFNet from an a session and the inputs and outpus endpoints
      of the TensorFlow graph.
      :param sess: the TensorFlow session contain all the variables
      :param inputs: a list of TensorFlow Tensor represents the input endpoints
      of the TensorFlow graph
      :param outputs: a list of TensorFlow Tensor represents the output endpoints
      of the TensorFlow graph
      :param tf_session_config: an optional tf.ConfigProto object to
                     set the session config in java side.
                     This config does not necessarily be the same with your current session.
                     E.g. sess_config = tf.ConfigProto(inter_op_parallelism_threads=1,
                                                       intra_op_parallelism_threads=1)
                          net = TFNet.from_session(sess, inputs, outputs, sess_config)
      :return a TFNet
      """
      from zoo.util.tf import export_tf
  
      temp = tempfile.mkdtemp()
      try:
          if generate_backward:
              logging.warning(
                  "generate_backward option is deprecated, and will be removed in"
                  + "in future releases, please use TFPark "
                  + "(https://analytics-zoo.github.io/master/"
                  + "#ProgrammingGuide/TFPark/tensorflow/) for TensorFlow training"
              )
              export_tf(
                  sess,
                  temp,
                  inputs,
                  outputs,
                  generate_backward,
                  allow_non_differentiable_input,
              )
              net = TFNet.from_export_folder(temp, tf_session_config)
          else:
              import tensorflow as tf
  
              init_op = tf.tables_initializer().name
              input_dict = dict([(t.name, t) for t in inputs])
              # work around feed and fetch the same tensor
              outputs = [tf.identity(out) for out in outputs]
              output_dict = dict([(t.name, t) for t in outputs])
              tf.saved_model.simple_save(
                  sess, temp, inputs=input_dict, outputs=output_dict
              )
              net = TFNet.from_saved_model(
                  temp,
                  inputs=[t.name for t in inputs],
                  outputs=[t.name for t in outputs],
                  tf_session_config=tf_session_config,
                  init_op=init_op,
              )
      finally:
          import shutil
  
          shutil.rmtree(temp)
  
      return net
  
imports: import os
  import sys
  import tempfile
  import numpy
  import six
  from pyspark import RDD
  from bigdl.nn.layer import Layer
  from zoo.common import JTensor
  from zoo.common.nncontext import getOrCreateSparkContext
  from zoo.common.utils import callZooFunc
  from zoo.feature.image import ImageSet
  from zoo.tfpark.tf_dataset import TFImageDataset, TFDataset
  import logging
  from zoo.util.utils import to_sample_rdd
label_desc: Use image node_id 7 for calling the TFNet obj's underlying member method code with example usage: obj.from_session(sess, inputs, outputs, generate_backward, allow_non_differentiable_input, tf_session_config) and returns: net