Gate-tunable photodetector and ambipolar transistor implemented using a graphene/MoSe2 barristor