Nonlinear optical effects in 2D materials can be used for neuromorphic computing systems. Here, the authors introduced free-space optical computing within a bare MoS2 array. Neural network and digital processing were demonstrated, showing fast speed, low energy consumption, and high signal-to-noise ratio.