torch/csrc/jit/passes/to_batch.cpp
// change return tensor to expanded batched tensor, eg: {data, mask, dims}
change return tensor to expanded batched tensor, eg: {data, mask, dims}
change return tensor to expanded batched tensor eg : { data mask dims }
void ToBatch::visitNumToTensor(Node* n, Block* block, Block* res_block){
  auto res_graph = res_block->owningGraph();
  auto* r_node = res_graph->createClone(n, rn_fn);
  r_node->setStage(n->stage());
  res_block->appendNode(r_node);
  auto outputs = script::inlineCallTo(*res_block->owningGraph(), *getBatchOperator("batch_from_scalar_tensor"), r_node->outputs());
  batch_map[n->output()] = outputs;
}
void ToBatch :: visitNumToTensor ( Node * n , Block * block , Block * res_block ) { auto res_graph = res_block -> owningGraph ( ) ; auto * r_node = res_graph -> createClone ( n , rn_fn ) ; r_node -> setStage ( n -> stage ( ) ) ; res_block -> appendNode ( r_node ) ; auto outputs = script :: inlineCallTo ( * res_block -> owningGraph ( ) , * getBatchOperator ( " " ) , r_node -> outputs ( ) ) ; batch_map [ n -> output ( ) ] = outputs ; }
change return tensor to expanded batched tensor, eg: {data, mask, dims}
change return tensor to expanded batched tensor eg : { data mask dims }