A layered graphene and chromium oxychloride device functions as a broadband optical synapse, detecting visible to deep infrared light and learning image orientation through built-in memory.