Two-dimensional (2D) materials with superior properties exhibit tremendous potential in developing next-generation electronic and optoelectronic devices. Integrating various functions into one device is highly expected as that endows 2D materials great promise for more Moore and more-than-Moore device applications. Here, we construct a WSe 2 /Ta 2 NiSe 5 heterostructure by stacking the p-type WSe 2 and the n-type narrow gap Ta 2 NiSe 5 with the aim to achieve a multifunction optoelectronic device. Owing to the large interface potential barrier, the heterostructure device reveals a prominent diode feature with a large rectify ratio (7.6 × 10 4 ) and a low dark current (10 -12 A). Especially, gate voltage- and bias voltage-tunable staggered-gap to broken-gap transition is achieved on the heterostructure device, which enables gate voltage-tunable forward and reverse rectifying features. As results, the heterostructure device exhibits superior self-powered photodetection properties, including a high detectivity of 1.08 × 10 10 Jones and a fast response time of 91 μs. Additionally, the intrinsic structural anisotropy of Ta 2 NiSe 5 endows the heterostructure device with strong polarization-sensitive photodetection and high-resolution polarization imaging. Based on these characteristics, a multimode optoelectronic logic gate is realized on the heterostructure via synergistically modulating the light on/off, polarization angle, gate voltage, and bias voltage. This work shed light on the future development of constructing high-performance multifunctional optoelectronic devices.