Launching them on the opposite side of the layer, if the bottom depth is permitting? Only when they reach the RTE length should they activate search mode and change to the set search depth. So it will then cross the layer.
Dr. Sids testing of sound layer effectiveness on sonar sensor detection suggested that the layer cannot prevent detection by sensors within a certain distance, iirc about 5 nm. So if the torpedo comes that close the target will likely notice the torpedo heading for it. But this is probably much closer than the no-escape range so it will likely be toast anyway.
Dr. Sid's thread:
http://www.subsim.com/radioroom/showthread.php?t=117814