Hi, Thank you for the exciting library. I have just observed that when we create the Training Plan then we provide sample data that Plan should expect during the training but Torchscript code hard code the batch size in its code.
How to Reproduce
Create Training Plan
Pass sample data including batch size
Build training plan as training_plan.build(X[:20], y[:20], batch_size, lr, model_params, trace_autograd=True)
Batch size should have to be dynamic because if we hard code then if total data is not divisible by batch size then torchscript throws an exception of dimension mismatch.
Description
Hi, Thank you for the exciting library. I have just observed that when we create the
Training Plan
then we provide sample data thatPlan
should expect during the training butTorchscript
code hard code thebatch size
in its code.How to Reproduce
Training Plan
training plan
astraining_plan.build(X[:20], y[:20], batch_size, lr, model_params, trace_autograd=True)
torchscript
code astraining_plan.base_framework = TranslationTarget.PYTORCH.value
print(training_plan.torchscript.code)
Expected Behavior
Batch size
should have to be dynamic because if we hard code then if total data is not divisible bybatch size
thentorchscript
throws an exception ofdimension
mismatch.