Using a DataCollator using native pytorch

Can anyone show me an example of using a DataCollator using native pytorch? I want to use it in a setting where I don’t want to be constrained by having to use it in a trainer class.