Repository navigation
check invalid string type for dest_nodes in extract_sub_graph - #13057
Conversation
|
Jenkins, test this please. |
|
@reedwm mind taking a look? |
| # Github 13047, cast single string to list | ||
| if isinstance(dest_nodes, str): | ||
| dest_nodes = [dest_nodes] | ||
| logging.warning("dest_nodes should be a list.") |
There was a problem hiding this comment.
Raise a TypeError instead. We shouldn't have a special case for passing in a string.
| raise TypeError("graph_def must be a graph_pb2.GraphDef proto.") | ||
|
|
||
| # Github 13047, cast single string to list | ||
| if isinstance(dest_nodes, str): |
There was a problem hiding this comment.
Use six.string_types instead of str. See saver.py for an example.
There was a problem hiding this comment.
Hi, @reedwm . If string is invalid, how about raising TypeError if only dest_nodes is not list? Please take a look at the latest commit, thanks.
| if not isinstance(graph_def, graph_pb2.GraphDef): | ||
| raise TypeError("graph_def must be a graph_pb2.GraphDef proto.") | ||
|
|
||
| # Github 13047, cast single string to list |
There was a problem hiding this comment.
I don't think this comment is necessary.
c12e52c to
0676b05
Compare
0676b05 to
8151f3b
Compare
| if not isinstance(graph_def, graph_pb2.GraphDef): | ||
| raise TypeError("graph_def must be a graph_pb2.GraphDef proto.") | ||
|
|
||
| if not isinstance(dest_nodes, list): |
There was a problem hiding this comment.
This will break existing code where dest_nodes is a non-list iterable, such as a tuple or set. Instead, you should raise an error if its not an instance of a collections.Iterable, or is an instance of six.string_types as I described above.
| self.assertEqual("n5", sub_graph.node[3].name) | ||
|
|
||
| def testExtractSubGraphWithInvalidDestNodes(self): | ||
| # Github issue, 13047 |
|
How about taking a test? Thanks. |
|
Jenkins, test this please. |
|
This test failure seems unrelated. rm: cannot remove '/workspace/tensorflow/contrib/makefile/gen/dep/tensorflow/contrib/makefile/downloads/fft2d/fftsg.d': Permission denied
make: *** [clean] Error 1
Build step 'Execute shell' marked build as failure
[Set GitHub commit status (universal)] ERROR on repos [] (sha:7702103) with context:tensorflow-pull-requests-makefile
Unable to get pull request builder trigger!! |
|
Jenkins, test this please. |
|
Yay! All tests passed. |
END_PUBLIC --- Commit 1e1b3d9 authored by Pete Warden<[email protected]> Committed by gunan<[email protected]>: Changed output directory for Pi CI build to fix permissions problem with nightlies (tensorflow#13257) * Fix for RTLD_GLOBAL breakage of Pi builds, and removed Eigen version change for Pi that's no longer needed * Fixed Pi Zero OpenBLAS build problems and tidied up directories used * More robust checks in Pi build script * Changed output directory for Pi CI build to fix permissions problem --- Commit fe3a2e6 authored by Yan Facai (???)<[email protected]> Committed by drpngx<[email protected]>: check invalid string type for dest_nodes in extract_sub_graph (tensorflow#13057) * BUG: check str type * TST: add unit test * CLN: remove list check * CLN: use warning * CLN: 2 indent * CLN: raise TypeError if not list * CLN: check string only --- Commit 225ab76 authored by Jean Wanka<[email protected]> Committed by Jean Wanka<[email protected]>: Fix polynomial decay with cycle for global step=0 For polynomial decay with cycle=True the learning rate at step 0 becomes NaN, because in the process of calculating it we devide by 0. This change should fix it, by setting the multiplier for the decay steps to one for global_step=0. --- Commit 286f570 authored by Bjarke Hammersholt Roune<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Make Service::TransferToClient not attempt to manipulate the literal when the transfer failed, preventing a crash and allowing the caller to see the reason for the failed transfer. PiperOrigin-RevId: 169770126 --- Commit e0501bc authored by Yong Tang<[email protected]> Committed by Shanqing Cai<[email protected]>: Fix GRUBlockCell parameter naming inconsistency (tensorflow#13153) * Fix GRUBlockCell parameter naming inconsistency This fix tries to fix the issue in 13137 where parameter `cell_size` is used instead of `num_units`. This is inconsistent with other RNN cells. This fix adds support of `num_units` while at the same time maintains backward compatiblility for `cell_size`. This fix fixes 13137. Signed-off-by: Yong Tang <[email protected]> * Add `@deprecated_args` for 'cell_size' in `GRUBlockCell` This commit adds `@deprecated_args` for 'cell_size' in `GRUBlockCell` Signed-off-by: Yong Tang <[email protected]> * Address review comment Signed-off-by: Yong Tang <[email protected]> --- Commit 02a2eba authored by Pete Warden<[email protected]> Committed by gunan<[email protected]>: Fix for RTLD_GLOBAL breakage of Pi builds, and removed Eigen version change that's no longer needed (tensorflow#13251) * Fix for RTLD_GLOBAL breakage of Pi builds, and removed Eigen version change for Pi that's no longer needed * Fixed Pi Zero OpenBLAS build problems and tidied up directories used * More robust checks in Pi build script --- Commit 8ef7222 authored by Sanjoy Das<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Remove a redundant setName. The EmitComputation should have emitted a function with the right name, so use a CHECK instead. PiperOrigin-RevId: 169764856 --- Commit 1b94147 authored by Neal Wu<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Fix broken GitHub links in tensorflow and tensorflow_models resulting from The Great Models Move (a.k.a. the research subfolder) PiperOrigin-RevId: 169763373 --- Commit b1ada5f authored by Justine Tunney<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Fix TensorBoard python -m invoke in docs PiperOrigin-RevId: 169758752 --- Commit 2957cd8 authored by Mustafa Ispir<[email protected]> Committed by TensorFlower Gardener<[email protected]>: Local run option of estimator training. PiperOrigin-RevId: 169756384 --- Commit 1dc2fe7 authored by Gunhan Gulsoy<[email protected]> Committed by TensorFlower Gardener<[email protected]>: BEGIN_PUBLIC Automated g4 rollback of changelist 166264198 PiperOrigin-RevId: 169998124
Fix #13047.
How to test