Optimize tf.split for eager mode
In eager mode, we know the shapes of input tensors and can use
more efficient methods for retrieving shape and rank. This change
reduces SPINN training time by about 1%. While 1% is not a lot, it is
a small localized change to a very commonly used op.
Also:
- Adapt split_op_test to run in both modes
- Decrease the number of splits in _testHugeNumberOfTensorsVariable
from 10k to 1k. I don't see much value in having such large
operations in a unit test. This reduces the total testing time
of split_test_op from 40 seconds to 4.6 seconds.
- Change TensorFlowTestCase.evaluate() to create a session if no default
session is setup.
PiperOrigin-RevId: 174349642
Loading
Please sign in to comment