Flexible silicon photonic architecture for accelerating distributed deep learning