Improvements to util/nest.py and data/util/nest.py
Changes:
- Add a cache for type -> is_sequence to speed up Flatten/IsSequence
- Update data/util/nest.py flatten to use C Flatten
Before:
entry {
name: "EagerLinearRegressionBenchmark.eager_train_cpu"
iters: 2000
wall_time: 1.
91852378845
extras {
key: "examples_per_sec"
value {
double_value: 66717.9634521
}
}
}
After:
entry {
name: "EagerLinearRegressionBenchmark.eager_train_cpu"
iters: 2000
wall_time: 1.
74479198456
extras {
key: "examples_per_sec"
value {
double_value: 73361.1806638
}
}
}
PiperOrigin-RevId:
197497854