@tf_export('block_lstm')
def block_lstm(seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b, forget_bias=1, cell_clip=3, use_peephole=False, name=None):
    "Computes the LSTM cell forward propagation for all the time steps.\n\n  This is equivalent to applying LSTMBlockCell in a loop, like so:\n\n  ```python\n  for x1 in unpack(x):\n    i1, cs1, f1, o1, ci1, co1, h1 = LSTMBlock(\n      x1, cs_prev, h_prev, w, wci, wcf, wco, b)\n    cs_prev = cs1\n    h_prev = h1\n    i.append(i1)\n    cs.append(cs1)\n    f.append(f1)\n    o.append(o1)\n    ci.append(ci1)\n    co.append(co1)\n    h.append(h1)\n  return pack(i), pack(cs), pack(f), pack(o), pack(ci), pack(ch), pack(h)\n  ```\n\n  Args:\n    seq_len_max: A `Tensor` of type `int64`.\n      Maximum time length actually used by this input. Outputs are padded\n      with zeros beyond this length.\n    x: A `Tensor`. Must be one of the following types: `half`, `float32`.\n      The sequence input to the LSTM, shape (timelen, batch_size, num_inputs).\n    cs_prev: A `Tensor`. Must have the same type as `x`.\n      Value of the initial cell state.\n    h_prev: A `Tensor`. Must have the same type as `x`.\n      Initial output of cell (to be used for peephole).\n    w: A `Tensor`. Must have the same type as `x`. The weight matrix.\n    wci: A `Tensor`. Must have the same type as `x`.\n      The weight matrix for input gate peephole connection.\n    wcf: A `Tensor`. Must have the same type as `x`.\n      The weight matrix for forget gate peephole connection.\n    wco: A `Tensor`. Must have the same type as `x`.\n      The weight matrix for output gate peephole connection.\n    b: A `Tensor`. Must have the same type as `x`. The bias vector.\n    forget_bias: An optional `float`. Defaults to `1`. The forget gate bias.\n    cell_clip: An optional `float`. Defaults to `3`.\n      Value to clip the 'cs' value to.\n    use_peephole: An optional `bool`. Defaults to `False`.\n      Whether to use peephole weights.\n    name: A name for the operation (optional).\n\n  Returns:\n    A tuple of `Tensor` objects (i, cs, f, o, ci, co, h).\n\n    i: A `Tensor`. Has the same type as `x`. The input gate over the whole time sequence.\n    cs: A `Tensor`. Has the same type as `x`. The cell state before the tanh over the whole time sequence.\n    f: A `Tensor`. Has the same type as `x`. The forget gate over the whole time sequence.\n    o: A `Tensor`. Has the same type as `x`. The output gate over the whole time sequence.\n    ci: A `Tensor`. Has the same type as `x`. The cell input over the whole time sequence.\n    co: A `Tensor`. Has the same type as `x`. The cell after the tanh over the whole time sequence.\n    h: A `Tensor`. Has the same type as `x`. The output h vector over the whole time sequence.\n  "
    _ctx = _context._context
    if ((_ctx is None) or (not _ctx._eager_context.is_eager)):
        if (forget_bias is None):
            forget_bias = 1
        forget_bias = _execute.make_float(forget_bias, 'forget_bias')
        if (cell_clip is None):
            cell_clip = 3
        cell_clip = _execute.make_float(cell_clip, 'cell_clip')
        if (use_peephole is None):
            use_peephole = False
        use_peephole = _execute.make_bool(use_peephole, 'use_peephole')
        (_, _, _op) = _op_def_lib._apply_op_helper('BlockLSTM', seq_len_max=seq_len_max, x=x, cs_prev=cs_prev, h_prev=h_prev, w=w, wci=wci, wcf=wcf, wco=wco, b=b, forget_bias=forget_bias, cell_clip=cell_clip, use_peephole=use_peephole, name=name)
        _result = _op.outputs[:]
        _inputs_flat = _op.inputs
        _attrs = ('forget_bias', _op.get_attr('forget_bias'), 'cell_clip', _op.get_attr('cell_clip'), 'use_peephole', _op.get_attr('use_peephole'), 'T', _op.get_attr('T'))
        _execute.record_gradient('BlockLSTM', _inputs_flat, _attrs, _result, name)
        _result = _BlockLSTMOutput._make(_result)
        return _result
    else:
        try:
            _result = _pywrap_tensorflow.TFE_Py_FastPathExecute(_ctx._context_handle, _ctx._eager_context.device_name, 'BlockLSTM', name, _ctx._post_execution_callbacks, seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b, 'forget_bias', forget_bias, 'cell_clip', cell_clip, 'use_peephole', use_peephole)
            _result = _BlockLSTMOutput._make(_result)
            return _result
        except _core._FallbackException:
            return block_lstm_eager_fallback(seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b, forget_bias=forget_bias, cell_clip=cell_clip, use_peephole=use_peephole, name=name, ctx=_ctx)
        except _core._NotOkStatusException as e:
            if (name is not None):
                message = ((e.message + ' name: ') + name)
            else:
                message = e.message
            _six.raise_from(_core._status_to_exception(e.code, message), None)
Computes the LSTM cell forward propagation for all the time steps.

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

```python
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)
```

Args:
  seq_len_max: A `Tensor` of type `int64`.
    Maximum time length actually used by this input. Outputs are padded
    with zeros beyond this length.
  x: A `Tensor`. Must be one of the following types: `half`, `float32`.
    The sequence input to the LSTM, shape (timelen, batch_size, num_inputs).
  cs_prev: A `Tensor`. Must have the same type as `x`.
    Value of the initial cell state.
  h_prev: A `Tensor`. Must have the same type as `x`.
    Initial output of cell (to be used for peephole).
  w: A `Tensor`. Must have the same type as `x`. The weight matrix.
  wci: A `Tensor`. Must have the same type as `x`.
    The weight matrix for input gate peephole connection.
  wcf: A `Tensor`. Must have the same type as `x`.
    The weight matrix for forget gate peephole connection.
  wco: A `Tensor`. Must have the same type as `x`.
    The weight matrix for output gate peephole connection.
  b: A `Tensor`. Must have the same type as `x`. The bias vector.
  forget_bias: An optional `float`. Defaults to `1`. The forget gate bias.
  cell_clip: An optional `float`. Defaults to `3`.
    Value to clip the 'cs' value to.
  use_peephole: An optional `bool`. Defaults to `False`.
    Whether to use peephole weights.
  name: A name for the operation (optional).

Returns:
  A tuple of `Tensor` objects (i, cs, f, o, ci, co, h).

  i: A `Tensor`. Has the same type as `x`. The input gate over the whole time sequence.
  cs: A `Tensor`. Has the same type as `x`. The cell state before the tanh over the whole time sequence.
  f: A `Tensor`. Has the same type as `x`. The forget gate over the whole time sequence.
  o: A `Tensor`. Has the same type as `x`. The output gate over the whole time sequence.
  ci: A `Tensor`. Has the same type as `x`. The cell input over the whole time sequence.
  co: A `Tensor`. Has the same type as `x`. The cell after the tanh over the whole time sequence.
  h: A `Tensor`. Has the same type as `x`. The output h vector over the whole time sequence.
@tf_export('block_lstm')
def block_lstm(seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b, forget_bias=1, cell_clip=3, use_peephole=False, name=None):
    "Computes the LSTM cell forward propagation for all the time steps.\n\n  This is equivalent to applying LSTMBlockCell in a loop, like so:\n\n  ```python\n  for x1 in unpack(x):\n    i1, cs1, f1, o1, ci1, co1, h1 = LSTMBlock(\n      x1, cs_prev, h_prev, w, wci, wcf, wco, b)\n    cs_prev = cs1\n    h_prev = h1\n    i.append(i1)\n    cs.append(cs1)\n    f.append(f1)\n    o.append(o1)\n    ci.append(ci1)\n    co.append(co1)\n    h.append(h1)\n  return pack(i), pack(cs), pack(f), pack(o), pack(ci), pack(ch), pack(h)\n  ```\n\n  Args:\n    seq_len_max: A `Tensor` of type `int64`.\n      Maximum time length actually used by this input. Outputs are padded\n      with zeros beyond this length.\n    x: A `Tensor`. Must be one of the following types: `half`, `float32`.\n      The sequence input to the LSTM, shape (timelen, batch_size, num_inputs).\n    cs_prev: A `Tensor`. Must have the same type as `x`.\n      Value of the initial cell state.\n    h_prev: A `Tensor`. Must have the same type as `x`.\n      Initial output of cell (to be used for peephole).\n    w: A `Tensor`. Must have the same type as `x`. The weight matrix.\n    wci: A `Tensor`. Must have the same type as `x`.\n      The weight matrix for input gate peephole connection.\n    wcf: A `Tensor`. Must have the same type as `x`.\n      The weight matrix for forget gate peephole connection.\n    wco: A `Tensor`. Must have the same type as `x`.\n      The weight matrix for output gate peephole connection.\n    b: A `Tensor`. Must have the same type as `x`. The bias vector.\n    forget_bias: An optional `float`. Defaults to `1`. The forget gate bias.\n    cell_clip: An optional `float`. Defaults to `3`.\n      Value to clip the 'cs' value to.\n    use_peephole: An optional `bool`. Defaults to `False`.\n      Whether to use peephole weights.\n    name: A name for the operation (optional).\n\n  Returns:\n    A tuple of `Tensor` objects (i, cs, f, o, ci, co, h).\n\n    i: A `Tensor`. Has the same type as `x`. The input gate over the whole time sequence.\n    cs: A `Tensor`. Has the same type as `x`. The cell state before the tanh over the whole time sequence.\n    f: A `Tensor`. Has the same type as `x`. The forget gate over the whole time sequence.\n    o: A `Tensor`. Has the same type as `x`. The output gate over the whole time sequence.\n    ci: A `Tensor`. Has the same type as `x`. The cell input over the whole time sequence.\n    co: A `Tensor`. Has the same type as `x`. The cell after the tanh over the whole time sequence.\n    h: A `Tensor`. Has the same type as `x`. The output h vector over the whole time sequence.\n  "
    _ctx = _context._context
    if ((_ctx is None) or (not _ctx._eager_context.is_eager)):
        if (forget_bias is None):
            forget_bias = 1
        forget_bias = _execute.make_float(forget_bias, 'forget_bias')
        if (cell_clip is None):
            cell_clip = 3
        cell_clip = _execute.make_float(cell_clip, 'cell_clip')
        if (use_peephole is None):
            use_peephole = False
        use_peephole = _execute.make_bool(use_peephole, 'use_peephole')
        (_, _, _op) = _op_def_lib._apply_op_helper('BlockLSTM', seq_len_max=seq_len_max, x=x, cs_prev=cs_prev, h_prev=h_prev, w=w, wci=wci, wcf=wcf, wco=wco, b=b, forget_bias=forget_bias, cell_clip=cell_clip, use_peephole=use_peephole, name=name)
        _result = _op.outputs[:]
        _inputs_flat = _op.inputs
        _attrs = ('forget_bias', _op.get_attr('forget_bias'), 'cell_clip', _op.get_attr('cell_clip'), 'use_peephole', _op.get_attr('use_peephole'), 'T', _op.get_attr('T'))
        _execute.record_gradient('BlockLSTM', _inputs_flat, _attrs, _result, name)
        _result = _BlockLSTMOutput._make(_result)
        return _result
    else:
        try:
            _result = _pywrap_tensorflow.TFE_Py_FastPathExecute(_ctx._context_handle, _ctx._eager_context.device_name, 'BlockLSTM', name, _ctx._post_execution_callbacks, seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b, 'forget_bias', forget_bias, 'cell_clip', cell_clip, 'use_peephole', use_peephole)
            _result = _BlockLSTMOutput._make(_result)
            return _result
        except _core._FallbackException:
            return block_lstm_eager_fallback(seq_len_max, x, cs_prev, h_prev, w, wci, wcf, wco, b, forget_bias=forget_bias, cell_clip=cell_clip, use_peephole=use_peephole, name=name, ctx=_ctx)
        except _core._NotOkStatusException as e:
            if (name is not None):
                message = ((e.message + ' name: ') + name)
            else:
                message = e.message
            _six.raise_from(_core._status_to_exception(e.code, message), None)