# BlockLSTM

public final class **BlockLSTM** Computes the LSTM cell forward propagation for all the time steps.


This is equivalent to applying LSTMBlockCell in a loop, like so:

    for x1 in unpack(x):
       i1, cs1, f1, o1, ci1, co1, h1 = LSTMBlock(
         x1, cs_prev, h_prev, w, wci, wcf, wco, b)
       cs_prev = cs1
       h_prev = h1
       i.append(i1)
       cs.append(cs1)
       f.append(f1)
       o.append(o1)
       ci.append(ci1)
       co.append(co1)
       h.append(h1)
     return pack(i), pack(cs), pack(f), pack(o), pack(ci), pack(ch), pack(h)
     
<br />

<br />

### Nested Classes

|---|---|---|---|
| class | [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options) || Optional attributes for `https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM` |

### Public Methods

|---|---|
| static [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options) | [cellClip](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#cellClip(java.lang.Float))(Float cellClip) |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [ci](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#ci())() The cell input over the whole time sequence. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [co](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#co())() The cell after the tanh over the whole time sequence. |
| static \<T extends Number\> [BlockLSTM](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM)\<T\> | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<java.lang.Long>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.Operand<T>,%20org.tensorflow.op.core.BlockLSTM.Options...))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Long\> seqLenMax, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> x, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> csPrev, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> hPrev, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> w, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> wci, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> wcf, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> wco, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> b, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options) options) Factory method to create a class wrapping a new BlockLSTM operation. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [cs](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#cs())() The cell state before the tanh over the whole time sequence. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [f](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#f())() The forget gate over the whole time sequence. |
| static [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options) | [forgetBias](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#forgetBias(java.lang.Float))(Float forgetBias) |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [h](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#h())() The output h vector over the whole time sequence. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [i](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#i())() The input gate over the whole time sequence. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\> | [o](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#o())() The output gate over the whole time sequence. |
| static [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options) | [usePeephole](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM#usePeephole(java.lang.Boolean))(Boolean usePeephole) |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options)
**cellClip**
(Float cellClip)

<br />

##### Parameters

| cellClip | Value to clip the 'cs' value to. |
|---|---|

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**ci**
()

The cell input over the whole time sequence.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**co**
()

The cell after the tanh over the whole time sequence.

#### public static [BlockLSTM](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM)\<T\>
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Long\> seqLenMax, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> x, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> csPrev, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> hPrev, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> w, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> wci, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> wcf, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> wco, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> b, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options) options)

Factory method to create a class wrapping a new BlockLSTM operation.

##### Parameters

| scope | current scope |
| seqLenMax | Maximum time length actually used by this input. Outputs are padded with zeros beyond this length. |
| x | The sequence input to the LSTM, shape (timelen, batch_size, num_inputs). |
| csPrev | Value of the initial cell state. |
| hPrev | Initial output of cell (to be used for peephole). |
| w | The weight matrix. |
| wci | The weight matrix for input gate peephole connection. |
| wcf | The weight matrix for forget gate peephole connection. |
| wco | The weight matrix for output gate peephole connection. |
| b | The bias vector. |
| options | carries optional attributes values |
|---|---|

##### Returns

- a new instance of BlockLSTM

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**cs**
()

The cell state before the tanh over the whole time sequence.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**f**
()

The forget gate over the whole time sequence.

#### public static [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options)
**forgetBias**
(Float forgetBias)

<br />

##### Parameters

| forgetBias | The forget gate bias. |
|---|---|

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**h**
()

The output h vector over the whole time sequence.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**i**
()

The input gate over the whole time sequence.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<T\>
**o**
()

The output gate over the whole time sequence.

#### public static [BlockLSTM.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/BlockLSTM.Options)
**usePeephole**
(Boolean usePeephole)

<br />

##### Parameters

| usePeephole | Whether to use peephole weights. |
|---|---|