Args: config (PredictConfig): the config to use.
(self, config)
| 154 | """ |
| 155 | |
| 156 | def __init__(self, config): |
| 157 | """ |
| 158 | Args: |
| 159 | config (PredictConfig): the config to use. |
| 160 | """ |
| 161 | self.graph = config._maybe_create_graph() |
| 162 | with self.graph.as_default(): |
| 163 | input = PlaceholderInput() |
| 164 | input.setup(config.input_signature) |
| 165 | with PredictTowerContext(''): |
| 166 | config.tower_func(*input.get_input_tensors()) |
| 167 | |
| 168 | input_tensors = get_tensors_by_names(config.input_names) |
| 169 | output_tensors = get_tensors_by_names(config.output_names) |
| 170 | |
| 171 | config.session_init._setup_graph() |
| 172 | sess = config.session_creator.create_session() |
| 173 | config.session_init._run_init(sess) |
| 174 | super(OfflinePredictor, self).__init__( |
| 175 | input_tensors, output_tensors, config.return_input, sess) |
nothing calls this directly
no test coverage detected