An in-memory computing architecture based on two-dimensional semiconductors for multiply-accumulate operations