MCPcopy Create free account
hub / github.com/pytorch/pytorch / enable_rnn_executor

Method enable_rnn_executor

caffe2/python/observer_test.py:143–154  ·  view source on GitHub ↗
(self, net, value, forward_only)

Source from the content-addressed store, hash-verified

141 self.assertEqual(run_cnt[1] - run_cnt[0], run_cnt[2] - run_cnt[1])
142
143 def enable_rnn_executor(self, net, value, forward_only):
144 num_found = 0
145 for op in net.Proto().op:
146 if op.type.startswith("RecurrentNetwork"):
147 for arg in op.arg:
148 if arg.name == 'enable_rnn_executor':
149 arg.i = value
150 num_found += 1
151 # This sanity check is so that if someone changes the
152 # enable_rnn_executor parameter name, the test will
153 # start failing as this function will become defective.
154 self.assertEqual(1 if forward_only else 2, num_found)

Callers 1

Calls 2

ProtoMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected