class_docstr: A DefaultReshapeHandler which deals with the sharding strategies for Reshape Op, such as torch.reshape.
class_docstr_tok: ["A","DefaultReshapeHandler","which","deals","with","the","sharding","strategies","for","Reshape","Op",",","such","as","torch.reshape","."]
docstr: This function is used to infer logical shape for operands.
  
  Notes: This function is only used for the operands whose data are not only in type of tensor,
          such as tuple of tensor.
docstr_tok: ["This","function","is","used","to","infer","logical","shape","for","operands",".","Notes",":","This","function","is","only","used","for","the","operands","whose","data","are","not","only","in","type","of","tensor",",","such","as","tuple","of","tensor","."]
code: def infer_logical_shape(self, data):
      """
      This function is used to infer logical shape for operands.
  
      Notes: This function is only used for the operands whose data are not only in type of tensor,
              such as tuple of tensor.
      """
      if isinstance(data, torch.Tensor):
          return data.shape
      else:
          assert isinstance(
              data, tuple
          ), "input_data should be a tuple of tensor or a tensor."
          logical_shape = []
          for tensor in data:
              assert isinstance(
                  tensor, torch.Tensor
              ), "input_data should be a tuple of tensor or a tensor."
              logical_shape.append(tensor.shape)
          logical_shape = tuple(logical_shape)
          return logical_shape
  
file_path: colossalai/colossalai/auto_parallel/tensor_shard/node_handler/default_reshape_handler.py
imports: from typing import Dict, List
  import torch
  from ..sharding_strategy import OperationData, OperationDataType
  from .node_handler import MetaInfoNodeHandler
  from .registry import operator_registry
  from .strategy import DefaultReshapeGenerator, StrategyGenerator
label_desc: Use image node_id 2 for calling the DefaultReshapeHandler obj's underlying member method code with example usage: obj.infer_logical_shape(data) and returns: data, logical_shape