Make `init_scope` preserve the active name scope.
authorAkshay Agrawal <akshayka@google.com>
Mon, 29 Jan 2018 17:57:20 +0000 (09:57 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 29 Jan 2018 18:01:24 +0000 (10:01 -0800)
commit3dd09f3707f5c0a73127165461b430c8729d65e0
tree0e97b4b3a677e67c0efb89fa9e5540ee2125abfd
parent3c7a7313738a1b5a1efa51bab79e377349bb8d7b
Make `init_scope` preserve the active name scope.

This ensures that operations nested under an `init_scope` do not ignore name scopes that were opened in a function-building graph. In light of cl/183320576, which causes `tfe.defun` to automatically hoist variables out of its function-building graph, this change also eliminates logic in make_template that special-cased the first call when `create_graph_function` was True.

PiperOrigin-RevId: 183680794
tensorflow/python/eager/function_test.py
tensorflow/python/framework/ops.py
tensorflow/python/framework/ops_test.py
tensorflow/python/kernel_tests/BUILD
tensorflow/python/kernel_tests/variables_test.py
tensorflow/python/ops/template.py