Lead‐Free Perovskites‐Based Photonic Synaptic Devices with Logic Functions