Skip to content

Commit 742cdaf

Browse files
committed
a few more tests for utils
1 parent 2d48b32 commit 742cdaf

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

python/tests/graph/test_utils.py

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,54 @@ def _gen_valid_tensor_op_objects():
5252
description='get op name from tensor (no graph)')
5353
yield TestCase(data=(op_name, tfx.op_name(tnsr, graph)),
5454
description='get op name from tensor (with graph)')
55+
yield TestCase(data=(op_name, tfx.op_name(tnsr_name)),
56+
description='get op name from tensor name (no graph)')
57+
yield TestCase(data=(op_name, tfx.op_name(tnsr_name, graph)),
58+
description='get op name from tensor name (with graph)')
59+
yield TestCase(data=(op_name, tfx.op_name(tnsr.op)),
60+
description='get op name from op (no graph)')
61+
yield TestCase(data=(op_name, tfx.op_name(tnsr.op, graph)),
62+
description='get op name from op (with graph)')
63+
yield TestCase(data=(op_name, tfx.op_name(op_name)),
64+
description='get op name from op name (no graph)')
65+
yield TestCase(data=(op_name, tfx.op_name(op_name, graph)),
66+
description='get op name from op name (with graph)')
67+
5568
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr)),
5669
description='get tensor name from tensor (no graph)')
5770
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr, graph)),
5871
description='get tensor name from tensor (with graph)')
72+
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr_name)),
73+
description='get tensor name from tensor name (no graph)')
74+
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr_name, graph)),
75+
description='get tensor name from tensor name (with graph)')
76+
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr.op)),
77+
description='get tensor name from op (no graph)')
78+
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr.op, graph)),
79+
description='get tensor name from op (with graph)')
80+
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr_name)),
81+
description='get tensor name from op name (no graph)')
82+
yield TestCase(data=(tnsr_name, tfx.tensor_name(tnsr_name, graph)),
83+
description='get tensor name from op name (with graph)')
84+
5985
yield TestCase(data=(tnsr, tfx.get_tensor(tnsr, graph)),
60-
description='get tensor from the same tensor (with graph)')
86+
description='get tensor from tensor (with graph)')
87+
yield TestCase(data=(tnsr, tfx.get_tensor(tnsr_name, graph)),
88+
description='get tensor from tensor name (with graph)')
89+
yield TestCase(data=(tnsr, tfx.get_tensor(tnsr.op, graph)),
90+
description='get tensor from op (with graph)')
91+
yield TestCase(data=(tnsr, tfx.get_tensor(op_name, graph)),
92+
description='get tensor from op name (with graph)')
93+
6194
yield TestCase(data=(tnsr.op, tfx.get_op(tnsr, graph)),
6295
description='get op from tensor (with graph)')
96+
yield TestCase(data=(tnsr.op, tfx.get_op(tnsr_name, graph)),
97+
description='get op from tensor name (with graph)')
98+
yield TestCase(data=(tnsr.op, tfx.get_op(tnsr.op, graph)),
99+
description='get op from op (with graph)')
100+
yield TestCase(data=(tnsr.op, tfx.get_op(op_name, graph)),
101+
description='get op from op name (with graph)')
102+
63103
yield TestCase(data=(graph, tfx.get_op(tnsr, graph).graph),
64104
description='get graph from retrieved op (with graph)')
65105
yield TestCase(data=(graph, tfx.get_tensor(tnsr, graph).graph),

0 commit comments

Comments
 (0)