In-memory photonic dot-product engine with electrically programmable weight banks