(self, factory, prefix="prefix", use_outer_scope=True)
| 320 | 1.0 * (2 + 1) * np.ones((input_size))))) |
| 321 | |
| 322 | def _testScope(self, factory, prefix="prefix", use_outer_scope=True): |
| 323 | with self.session(use_gpu=True, graph=ops.Graph()): |
| 324 | if use_outer_scope: |
| 325 | with variable_scope.variable_scope(prefix) as scope: |
| 326 | factory(scope) |
| 327 | else: |
| 328 | factory(prefix) |
| 329 | |
| 330 | # check that all the variables names starts |
| 331 | # with the proper scope. |
| 332 | variables_lib.global_variables_initializer() |
| 333 | all_vars = variables_lib.global_variables() |
| 334 | prefix = prefix or "rnn" |
| 335 | scope_vars = [v for v in all_vars if v.name.startswith(prefix + "/")] |
| 336 | tf_logging.info("RNN with scope: %s (%s)" % |
| 337 | (prefix, "scope" if use_outer_scope else "str")) |
| 338 | for v in scope_vars: |
| 339 | tf_logging.info(v.name) |
| 340 | self.assertEqual(len(scope_vars), len(all_vars)) |
| 341 | |
| 342 | @test_util.run_v1_only("b/124229375") |
| 343 | def testScope(self): |
no test coverage detected