Data Transformation a part of model graph

Can we make transformations a part of model graph in pytorch so that data preprocessing is not done at the client side too, just like we can with tensorflow (tfx)?

To explain it in more detail:
When we define transformations in pytorch which is basically a pre-process step.
For example, lets say i have a dataset of images,
colored images 512*768but i trained the model on b&w, center cropped, resized images, so this is the transformation i chose.
now at real time predictions, when you will write the client side code,
you may need to define this transformation there too,
since your model’s input layer will expect a specific shape wrt channel, size etc. so in tensorflow it is possible to define whatever transformation we did, as a part of the model graph

so at real time we don’t have to make any manipulations
just send the raw data.
while in pytorch i couldn’t find a way to offload this dependency.

If I am rightly understanding your question than you can use non-sequential modeling to do that.