Separate out encoding a decoding steps.
Separate out encoding a decoding steps.

PiperOrigin-RevId: 168579149

tensorflow/tensor2tensor,rsepassi/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,waterblue13/tensor2tensor,rsepassi/tensor2tensor,vthorsteinsson/tensor2tensor,vthorsteinsson/tensor2tensor,tensorflow/tensor2tensor,tensorflow/tensor2tensor,vthorsteinsson/tensor2tensor,rsepassi/tensor2tensor,rsepassi/tensor2tensor,tensorflow/tensor2tensor,waterblue13/tensor2tensor,waterblue13/tensor2tensor