parameters: (self, x)
return_statement: return singa.Reshape(x, cur)
docstring: Args:
              x (CTensor): Input tensor
          Returns:
              CTensor, the output
docstring_summary: Args:
              x (CTensor): Input tensor
          Returns:
              CTensor, the output
docstring_tokens: Args : x ( CTensor ) : Input tensor Returns : CTensor the output
function: def forward(self, x):
          """
          Args:
              x (CTensor): Input tensor
          Returns:
              CTensor, the output
          """
          self.cache = x.shape()
          cur = list(self.cache)
          # todo, need optimize after we have scalar tensor
          if len(self.cache) == 1 and self.axis == [0]:
              return x
          for i in self.axis:
              cur.insert(i, 1)
          return singa.Reshape(x, cur)
function_tokens: def forward ( self , x ) : self . cache = x . shape ( ) cur = list ( self . cache ) # todo, need optimize after we have scalar tensor if len ( self . cache ) == 1 and self . axis == [ 0 ] : return x for i in self . axis : cur . insert ( i , 1 ) return singa . Reshape ( x , cur )