def scatter_kwargs(inputs, kwargs, target_gpus, dim=<NUM_LIT:0>):
inputs = scatter(inputs, target_gpus, dim) if inputs else []<EOL>kwargs = scatter(kwargs, target_gpus, dim) if kwargs else []<EOL>if len(inputs) < len(kwargs):<EOL><INDENT>inputs.extend([() for _ in range(len(kwargs) - len(inputs))])<EOL><DEDENT>elif len(kwargs) < len(inputs):<EOL><INDENT>kwargs.extend([{} for _ in range(len(inputs) - len(kwargs))])<EOL><DEDENT>inputs = tuple(inputs)<EOL>kwargs = tuple(kwargs)<EOL>return inputs, kwargs<EOL>
Scatter with support for kwargs dictionary