anchor.diff:              if bias then r.hidden <- r.hidden + b.value
               r.hidden <- nonlinearity r.hidden
               output.[i] <- r.hidden
  -        dsharp.stack output
  +        let output = dsharp.stack output
  +        if batchFirst then output.transpose(0, 1) else output
   
   
  -type RNN(inFeatures, outFeatures, ?nonlinearity, ?numLayers, ?bias, ?dropout, ?bidirectional) =
  +type RNN(inFeatures, outFeatures, ?numLayers, ?nonlinearity, ?bias, ?batchFirst, ?dropout, ?bidirectional) =
       inherit Model()
       let numLayers = defaultArg numLayers 1
       let dropout = defaultArg dropout 0.
       let bidirectional = defaultArg bidirectional false
  +    let batchFirst = defaultArg batchFirst false
       let numDirections = if bidirectional then 2 else 1
       let makeLayers () = Array.init numLayers (fun i -> if i = 0 then RNNCell(inFeatures, outFeatures, ?nonlinearity=nonlinearity, ?bias=bias) else RNNCell(outFeatures, outFeatures, ?nonlinearity=nonlinearity, ?bias=bias))
       let layers = makeLayers()
  
positive.code:     member r.reset() = r.hidden <- dsharp.tensor([])
  
      override r.forward(value) =
          let seqLen, batchSize = rnnShape value inFeatures
          if r.hidden.nelement = 0 then r.hidden <- dsharp.zeros([batchSize; outFeatures])
          let output = Array.create seqLen (dsharp.tensor([]))
          for i in 0..seqLen-1 do
  
negative.code:     let hs = Parameter <| dsharp.tensor([])
      do 
          base.add(layers |> Array.map box, Array.init numLayers (fun i -> sprintf "RNN-layer-%A" i))
          if bidirectional then base.add(layersReverse |> Array.map box, Array.init numLayers (fun i -> sprintf "RNN-layer-reverse-%A" i))
          if dropout > 0. then base.add([dropoutLayer], ["RNN-dropout"])
  
      member _.hidden
  