parameters: (self, x, brickSize)
return_statement: return out
docstring: x: Input data in numpy. Expected to be a 3D tensor  with shape
              [timeStep, batchSize, featureDim]. Note that this is different from
              the convention followed in the TF codebase.
          brickSize: The brick size for the lower dimension. The input data will
              be divided into bricks along the timeStep axis (axis=0) internally
              and fed into the lowest layer RNN. Note that if the last brick has
              fewer than 'brickSize' steps, it will be ignored (no internal
              padding is done).
docstring_summary: x: Input data in numpy. Expected to be a 3D tensor  with shape
              [timeStep, batchSize, featureDim]. Note that this is different from
              the convention followed in the TF codebase.
          brickSize: The brick size for the lower dimension. The input data will
              be divided into bricks along the timeStep axis (axis=0) internally
              and fed into the lowest layer RNN. Note that if the last brick has
              fewer than 'brickSize' steps, it will be ignored (no internal
              padding is done).
docstring_tokens: x : Input data in numpy . Expected to be a 3D tensor with shape [ timeStep batchSize featureDim ] . Note that this is different from the convention followed in the TF codebase . brickSize : The brick size for the lower dimension . The input data will be divided into bricks along the timeStep axis ( axis = 0 ) internally and fed into the lowest layer RNN . Note that if the last brick has fewer than brickSize steps it will be ignored ( no internal padding is done ) .
function: def forward(self, x, brickSize):
          '''
          x: Input data in numpy. Expected to be a 3D tensor  with shape
              [timeStep, batchSize, featureDim]. Note that this is different from
              the convention followed in the TF codebase.
          brickSize: The brick size for the lower dimension. The input data will
              be divided into bricks along the timeStep axis (axis=0) internally
              and fed into the lowest layer RNN. Note that if the last brick has
              fewer than 'brickSize' steps, it will be ignored (no internal
              padding is done).
          '''
          assert x.ndimension() == 3
          assert list(x.size())[2] == self.inputDim
          x_bricks = self.getBrickedData(x, brickSize)
          # x bricks: [numBricks, brickSize, batchSize, featureDim]
          x_bricks = x_bricks.permute(1,0,2,3)
          # x bricks: [brickSize, numBricks, batchSize, featureDim]
          oldShape = list(x_bricks.size())
          x_bricks = torch.reshape(x_bricks, [oldShape[0], oldShape[1] * oldShape[2], oldShape[3]])
          # x bricks: [brickSize, numBricks * batchSize, featureDim]
          # x_bricks = torch.Tensor(x_bricks)
  
          self.dropoutLayer0 = None
          self.dropoutLayer1 = None
  
          if self.cellType == 'LSTM':
              hidd0, out0 = self.rnn0(x_bricks)
          else:
              hidd0 = self.rnn0(x_bricks)
  
          if self.dropoutProbability0 != None:
              self.dropoutLayer0 = nn.Dropout(p=self.dropoutProbability0)
              hidd0 = self.dropoutLayer0(hidd0)
          hidd0 = torch.squeeze(hidd0[-1])
          # [numBricks * batchSize, hiddenDim0]
          inp1 = hidd0.view(oldShape[1], oldShape[2], self.hiddenDim0)
          # [numBricks, batchSize, hiddenDim0]
          if self.cellType == 'LSTM':
              hidd1, out1 = self.rnn1(inp1)
          else:
              hidd1 = self.rnn1(inp1)
          if self.dropoutProbability1 != None:
              self.dropoutLayer1 = nn.Dropout(p=self.dropoutProbability1)
              hidd1 = self.dropoutLayer1(hidd1)
          hidd1 = torch.squeeze(hidd1[-1])
          out = torch.matmul(hidd1, self.W) + self.B
          return out
function_tokens: def forward ( self , x , brickSize ) : assert x . ndimension ( ) == 3 assert list ( x . size ( ) ) [ 2 ] == self . inputDim x_bricks = self . getBrickedData ( x , brickSize ) # x bricks: [numBricks, brickSize, batchSize, featureDim] x_bricks = x_bricks . permute ( 1 , 0 , 2 , 3 ) # x bricks: [brickSize, numBricks, batchSize, featureDim] oldShape = list ( x_bricks . size ( ) ) x_bricks = torch . reshape ( x_bricks , [ oldShape [ 0 ] , oldShape [ 1 ] * oldShape [ 2 ] , oldShape [ 3 ] ] ) # x bricks: [brickSize, numBricks * batchSize, featureDim] # x_bricks = torch.Tensor(x_bricks) self . dropoutLayer0 = None self . dropoutLayer1 = None if self . cellType == 'LSTM' : hidd0 , out0 = self . rnn0 ( x_bricks ) else : hidd0 = self . rnn0 ( x_bricks ) if self . dropoutProbability0 != None : self . dropoutLayer0 = nn . Dropout ( p = self . dropoutProbability0 ) hidd0 = self . dropoutLayer0 ( hidd0 ) hidd0 = torch . squeeze ( hidd0 [ - 1 ] ) # [numBricks * batchSize, hiddenDim0] inp1 = hidd0 . view ( oldShape [ 1 ] , oldShape [ 2 ] , self . hiddenDim0 ) # [numBricks, batchSize, hiddenDim0] if self . cellType == 'LSTM' : hidd1 , out1 = self . rnn1 ( inp1 ) else : hidd1 = self . rnn1 ( inp1 ) if self . dropoutProbability1 != None : self . dropoutLayer1 = nn . Dropout ( p = self . dropoutProbability1 ) hidd1 = self . dropoutLayer1 ( hidd1 ) hidd1 = torch . squeeze ( hidd1 [ - 1 ] ) out = torch . matmul ( hidd1 , self . W ) + self . B return out