adds support for specifiying batch size for each grid