from tensorflow.contrib.opt import ScipyOptimizerInterface

                if type(method) is str:
                    success_msg = "SciPy optimizer completed successfully."
                    options = {'maxiter': maxiter, 'disp': True}
                    options.update(kw)
                    optimizer = ScipyOptimizerInterface(
                        loss, var_list=variables, method=method, 
                        options=options
                    )
