Adding data parallel support for torch backend (#23316)