# Path: util/utils.py
# def fully_connected(input_layer, input_size, output_size, weight_init,
#                     bias_init, scope, trainable):
#   with tf.variable_scope(scope):
#     w = tf.get_variable(
#         "w", [input_size, output_size],
#         initializer=weight_init,
#         trainable=trainable)
#     b = tf.get_variable(
#         "b", [output_size], initializer=bias_init, trainable=trainable)
#   return tf.matmul(input_layer, w) + b
# 
# Path: util/model_saver.py
# def save_tf_model(sess, model_path, tf_var_list=[]):
# def save_numpy_model(model_path, numpy_var_list=[]):
# def load_tf_model(sess, model_path, tf_var_list=[], ignore_prefix='INVALID',
#                   transfer_env='Nothing2Nothing', logstd_option='load',
#                   gnn_option_list=None, mlp_raw_transfer=False):
# def load_numpy_model(model_path, numpy_var_list={}):
# def model_save_from_list(sess, model_path, tf_var_list=[], numpy_var_list={}):
# def model_load_from_list(sess, model_path, tf_var_list=[], numpy_var_list={},
#                          target_scope_switch='trpo_agent_policy'):
# def is_file_valid(model_path, save_file=False):


import init_path
import tensorflow as tf
import numpy as np
from util.utils import fully_connected
from util import model_saver
        self._all_var_list = [var for var in tf.global_variables()
                              if self._name_scope in var.name]

    def get_action_dist_mu(self):
        return self._action_mu_output

    def get_action_dist_logstd_param(self):
        return self._action_dist_logstd_param

    def get_input_placeholder(self):
        return self._input

    def get_var_list(self):
        return self._trainable_var_list, self._all_var_list

    def get_iteration_var(self):
        return self._iteration

    def load_checkpoint(self, ckpt_path,
                        transfer_env='Nothing2Nothing', logstd_option='load',
                        gnn_option_list=None, mlp_raw_transfer=False):
        # in this function, we check if the checkpoint has been loaded
        model_saver.load_tf_model(self._session, ckpt_path,
                                  tf_var_list=self._all_var_list,
                                  transfer_env=transfer_env,
                                  logstd_option=logstd_option,
                                  gnn_option_list=gnn_option_list,
                                  mlp_raw_transfer=mlp_raw_transfer)

    def save_checkpoint(self, ckpt_path):

# Path: util/utils.py
# def fully_connected(input_layer, input_size, output_size, weight_init,
#                     bias_init, scope, trainable):
#   with tf.variable_scope(scope):
#     w = tf.get_variable(
#         "w", [input_size, output_size],
#         initializer=weight_init,
#         trainable=trainable)
#     b = tf.get_variable(
#         "b", [output_size], initializer=bias_init, trainable=trainable)
#   return tf.matmul(input_layer, w) + b
# 
# Path: util/model_saver.py
# def save_tf_model(sess, model_path, tf_var_list=[]):
# def save_numpy_model(model_path, numpy_var_list=[]):
# def load_tf_model(sess, model_path, tf_var_list=[], ignore_prefix='INVALID',
#                   transfer_env='Nothing2Nothing', logstd_option='load',
#                   gnn_option_list=None, mlp_raw_transfer=False):
# def load_numpy_model(model_path, numpy_var_list={}):
# def model_save_from_list(sess, model_path, tf_var_list=[], numpy_var_list={}):
# def model_load_from_list(sess, model_path, tf_var_list=[], numpy_var_list={},
#                          target_scope_switch='trpo_agent_policy'):
# def is_file_valid(model_path, save_file=False):


# Path: network/policy_network.py
import init_path
import tensorflow as tf
import numpy as np
from util.utils import fully_connected
from util import model_saver

        self._all_var_list = [var for var in tf.global_variables()
                              if self._name_scope in var.name]

    def get_action_dist_mu(self):
        return self._action_mu_output

    def get_action_dist_logstd_param(self):
        return self._action_dist_logstd_param

    def get_input_placeholder(self):
        return self._input

    def get_var_list(self):
        return self._trainable_var_list, self._all_var_list

    def get_iteration_var(self):
        return self._iteration

    def load_checkpoint(self, ckpt_path,
                        transfer_env='Nothing2Nothing', logstd_option='load',
                        gnn_option_list=None, mlp_raw_transfer=False):
        # in this function, we check if the checkpoint has been loaded
        model_saver.load_tf_model(self._session, ckpt_path,
                                  tf_var_list=self._all_var_list,
                                  transfer_env=transfer_env,
                                  logstd_option=logstd_option,
                                  gnn_option_list=gnn_option_list,
                                  mlp_raw_transfer=mlp_raw_transfer)

    def save_checkpoint(self, ckpt_path):

        model_saver.save_tf_model(self._session, ckpt_path, self._all_var_list)