As I've stated previously when the B-17 was originally conceived and built, one of its intended roles was anti-shipping,
in effect flying coast artillery. The B-17 could carry large bombs externally, so a torpedo aint' much of as stretch, indeed
it was used to launch glide-torpedoes on test.
http://www.criticalpast.com/video/65675036014_Guided-Torpedo-GT-1_B-17-bomber_United-States-Army-Air-Corps_attaching-bomb-to-a-planeBTW when the Model 299/B-17 was conceived and built, in 1934-35 as a purely speculative private venture, well before
the specification that
eventually led to the Lancaster was even issued, the bomb-bay was not considered small.
Oh yeah, the competition for which Boeing built the B-17 was not for a 'heavy bomber', it was to a May 1934 request for
a 'multi-engine bomber capable of carrying a 2,000lb load at least 1,020 miles (2,200 miles if possible) at at least 200
mph (250 mph if possible), the other competitors were the twin-engined Douglas B-18 and the Martin 146.
The US heavy bomber competition that originated in 1935 was between the Douglas XBLR-2 (XB-19) and Sikorsky XBLR-3.
Anyhow on the IJN 'heavy' torpedo bombers, G3M and G4M, the bomb doors were removed and the weapons were carried exposed when they were on torpedo missions. Indeed it seems that of the
large aircraft
actually used for torpedo attacks, only the Wellington carried the weapons fully internally.