How to enable Subset to inherit methods from custom Dataset?

My use case is very similar to the question asked on stack overflow. Link below

Is there a way to achieve this?