Split an input tensor

Double post from here with a potential answer.