Quantum learning without quantum memory