In [33]:
import numpy as np
import tensorflow as tf
from tensorflow.python.layers.core import Dense
tf.__version__


Out[33]:
'1.2.0'

In [8]:
# https://github.com/tensorflow/tensorflow/issues/10815

In [9]:
n_steps = 14
n_input = 2
n_output = 1

In [10]:
def get_batch(batch_size):
    x = np.random.uniform(0, 1, size=[batch_size,n_steps, n_input])
    y = np.flip(x, axis=1)
    y = np.sum(y, axis=2)
    y = y.reshape((batch_size, n_steps, 1))
    
    seq = np.empty((batch_size), dtype=np.int)
    seq.fill(n_steps)
    return x, y, seq

x, y, seq = get_batch(100)

In [38]:
n_steps = 14
n_input = 2
n_output = 1
inp_seq_len = out_seq_len = n_steps
layers_stacked_count = 2  # Number of stacked recurrent cells, on the neural depth axis. 
n_hidden = 20

tf.reset_default_graph()

sess = tf.InteractiveSession()

# Placeholders
enc_inp = tf.placeholder(tf.float32, [None, inp_seq_len, n_input], name='encoder_input')
dec_target = tf.placeholder(tf.float32, [None, out_seq_len, n_output], name ='decoder_input')
#dec_targets = [tf.placeholder(tf.float32, [None, n_output]) for i in range(out_seq_len)]

target_length = tf.placeholder(tf.int32, [None], name='target_seq_length')
keep_prob = tf.placeholder(tf.float32, [], name='dropout_keep_prob')
sample_rate = tf.placeholder(tf.float32, [], name = 'sample_rate')

# ---- Encoder
enc_cells = [tf.contrib.rnn.DropoutWrapper(tf.contrib.rnn.BasicLSTMCell(n_hidden), output_keep_prob=keep_prob) for i in range(layers_stacked_count)]
enc_stk_cell = tf.contrib.rnn.MultiRNNCell(enc_cells)

encoded_outputs, encoded_states = tf.nn.dynamic_rnn(enc_stk_cell, enc_inp, dtype=tf.float32)

# ---- Decoder
dec_cells = [tf.contrib.rnn.DropoutWrapper(tf.contrib.rnn.BasicLSTMCell(n_hidden), output_keep_prob=keep_prob) for i in range(layers_stacked_count)]
dec_stk_cell = tf.contrib.rnn.MultiRNNCell(dec_cells)

#helper = tf.contrib.seq2seq.TrainingHelper(expect, expect_length) # Old
#n_in_layer = tf.layers.dense()
hlay = Dense(n_output, dtype=tf.float32)
print(type(hlay))
helper = tf.contrib.seq2seq.ScheduledOutputTrainingHelper(dec_target, target_length, sample_rate, next_input_layer=hlay)

decoder = tf.contrib.seq2seq.BasicDecoder(cell=dec_stk_cell, helper=helper, initial_state=encoded_states)

decoder_outputs, final_decoder_state, length = tf.contrib.seq2seq.dynamic_decode(decoder)
decoder_logits = decoder_outputs.rnn_output

h = tf.contrib.layers.fully_connected(decoder_logits, n_output)

diff = tf.squared_difference(h, dec_target)
batch_loss = tf.reduce_sum(diff, axis=1)
loss = tf.reduce_mean(batch_loss)

optimiser = tf.train.AdamOptimizer(1e-3)
training_op = optimiser.minimize(loss)

init_op = tf.global_variables_initializer()


<class 'tensorflow.python.layers.core.Dense'>

In [39]:
sess = tf.InteractiveSession()

init_op.run()

for e in range(10):
    for i in range(100):
        batch_x, batch_y ,seq = get_batch(100)
        training_op.run(feed_dict={enc_inp:batch_x, dec_target: batch_y, target_length:seq, keep_prob:0.5, sample_rate:0.5})
        
    print(loss.eval(feed_dict={enc_inp:batch_x, dec_target: batch_y, target_length:seq, keep_prob:1,sample_rate:0}))


2.1538
1.93195
1.86243
1.22235
1.02921
0.855889
0.733073
0.684626
0.629023
0.498449

In [32]:
test_x, test_y, seq = get_batch(2)
print(test_y[0])
print('---------')
feed_dict = {enc_inp:test_x, target_length:seq, keep_prob:1, sample_rate:0}
pred = h.eval(feed_dict=feed_dict)

print(test_y[0]-pred[0])


[[ 0.98417242]
 [ 0.62155374]
 [ 0.52138793]
 [ 1.16872927]
 [ 1.03178255]
 [ 1.45997571]
 [ 1.27879388]
 [ 0.64727848]
 [ 0.74829998]
 [ 1.11627821]
 [ 0.22984916]
 [ 0.83748326]
 [ 1.14607962]
 [ 1.30477196]]
---------
---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1138     try:
-> 1139       return fn(*args)
   1140     except errors.OpError as e:

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
   1120                                  feed_dict, fetch_list, target_list,
-> 1121                                  status, run_metadata)
   1122 

/usr/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
     65             try:
---> 66                 next(self.gen)
     67             except StopIteration:

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
    465           compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 466           pywrap_tensorflow.TF_GetCode(status))
    467   finally:

InvalidArgumentError: Shape [-1,14,1] has negative dimensions
	 [[Node: decoder_input = Placeholder[dtype=DT_FLOAT, shape=[?,14,1], _device="/job:localhost/replica:0/task:0/gpu:0"]()]]

During handling of the above exception, another exception occurred:

InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-32-5458833a0960> in <module>()
      3 print('---------')
      4 feed_dict = {enc_inp:test_x, target_length:seq, keep_prob:1, sample_rate:0}
----> 5 pred = h.eval(feed_dict=feed_dict)
      6 
      7 print(test_y[0]-pred[0])

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py in eval(self, feed_dict, session)
    604 
    605     """
--> 606     return _eval_using_default_session(self, feed_dict, self.graph, session)
    607 
    608 

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py in _eval_using_default_session(tensors, feed_dict, graph, session)
   3926                        "the tensor's graph is different from the session's "
   3927                        "graph.")
-> 3928   return session.run(tensors, feed_dict)
   3929 
   3930 

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
    787     try:
    788       result = self._run(None, fetches, feed_dict, options_ptr,
--> 789                          run_metadata_ptr)
    790       if run_metadata:
    791         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
    995     if final_fetches or final_targets:
    996       results = self._do_run(handle, final_targets, final_fetches,
--> 997                              feed_dict_string, options, run_metadata)
    998     else:
    999       results = []

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1130     if handle is None:
   1131       return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1132                            target_list, options, run_metadata)
   1133     else:
   1134       return self._do_call(_prun_fn, self._session, handle, feed_dict,

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1150         except KeyError:
   1151           pass
-> 1152       raise type(e)(node_def, op, message)
   1153 
   1154   def _extend_graph(self):

InvalidArgumentError: Shape [-1,14,1] has negative dimensions
	 [[Node: decoder_input = Placeholder[dtype=DT_FLOAT, shape=[?,14,1], _device="/job:localhost/replica:0/task:0/gpu:0"]()]]

Caused by op 'decoder_input', defined at:
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 177, in start
    super(ZMQIOLoop, self).start()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tornado/ioloop.py", line 888, in start
    handler_func(fd_obj, events)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
    self._handle_recv()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
    callback(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 235, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 196, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 533, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2683, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2787, in run_ast_nodes
    if self.run_code(code, result):
  File "/home/ppyht2/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2847, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-29-78f2f97a2384>", line 14, in <module>
    dec_target = tf.placeholder(tf.float32, [None, out_seq_len, n_output], name ='decoder_input')
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1530, in placeholder
    return gen_array_ops._placeholder(dtype=dtype, shape=shape, name=name)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1954, in _placeholder
    name=name)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
    op_def=op_def)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2506, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1269, in __init__
    self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Shape [-1,14,1] has negative dimensions
	 [[Node: decoder_input = Placeholder[dtype=DT_FLOAT, shape=[?,14,1], _device="/job:localhost/replica:0/task:0/gpu:0"]()]]

In [16]:
import tensorflow as tf
with tf.Graph().as_default():
    batch_size = 32
    nsteps = 100
    ndims = 5
    sequence_length = [nsteps] * batch_size
    sampling_probability = 0.5
    num_units = 20

    cell = tf.contrib.rnn.BasicRNNCell(
        num_units,
    )

    inputs = tf.random_uniform((batch_size, nsteps, ndims))

    output, state = tf.nn.dynamic_rnn(
        cell,
        inputs,
        dtype=tf.float32,
    )

    cell = tf.contrib.rnn.BasicRNNCell(
        num_units,
    )

    helper = tf.contrib.seq2seq.ScheduledOutputTrainingHelper(
        output,
        sequence_length,
        sampling_probability,
    )

    initial_state = tf.zeros((batch_size, num_units))
    decoder = tf.contrib.seq2seq.BasicDecoder(
        cell,
        helper,
        initial_state,
    )

    decoded = tf.contrib.seq2seq.dynamic_decode(
        decoder,
    )

    run_ops = {'decoded': decoded}
    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        ret = sess.run(run_ops)


---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1138     try:
-> 1139       return fn(*args)
   1140     except errors.OpError as e:

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
   1120                                  feed_dict, fetch_list, target_list,
-> 1121                                  status, run_metadata)
   1122 

/usr/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
     65             try:
---> 66                 next(self.gen)
     67             except StopIteration:

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
    465           compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 466           pywrap_tensorflow.TF_GetCode(status))
    467   finally:

InvalidArgumentError: TensorArray dtype is int32 but Op is trying to write dtype bool.
	 [[Node: decoder/while/TensorArrayWrite_1/TensorArrayWriteV3 = TensorArrayWriteV3[T=DT_BOOL, _class=["loc:@decoder/while/BasicDecoderStep/ScheduledOutputTrainingHelperSample/Cast"], _device="/job:localhost/replica:0/task:0/cpu:0"](decoder/while/TensorArrayWrite_1/TensorArrayWriteV3/Enter, decoder/while/Identity/_55, decoder/while/BasicDecoderStep/ScheduledOutputTrainingHelperSample/Cast, decoder/while/Identity_2/_57)]]

During handling of the above exception, another exception occurred:

InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-16-aff58c38b4b8> in <module>()
     44     with tf.Session() as sess:
     45         sess.run(tf.global_variables_initializer())
---> 46         ret = sess.run(run_ops)

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
    787     try:
    788       result = self._run(None, fetches, feed_dict, options_ptr,
--> 789                          run_metadata_ptr)
    790       if run_metadata:
    791         proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
    995     if final_fetches or final_targets:
    996       results = self._do_run(handle, final_targets, final_fetches,
--> 997                              feed_dict_string, options, run_metadata)
    998     else:
    999       results = []

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
   1130     if handle is None:
   1131       return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1132                            target_list, options, run_metadata)
   1133     else:
   1134       return self._do_call(_prun_fn, self._session, handle, feed_dict,

/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
   1150         except KeyError:
   1151           pass
-> 1152       raise type(e)(node_def, op, message)
   1153 
   1154   def _extend_graph(self):

InvalidArgumentError: TensorArray dtype is int32 but Op is trying to write dtype bool.
	 [[Node: decoder/while/TensorArrayWrite_1/TensorArrayWriteV3 = TensorArrayWriteV3[T=DT_BOOL, _class=["loc:@decoder/while/BasicDecoderStep/ScheduledOutputTrainingHelperSample/Cast"], _device="/job:localhost/replica:0/task:0/cpu:0"](decoder/while/TensorArrayWrite_1/TensorArrayWriteV3/Enter, decoder/while/Identity/_55, decoder/while/BasicDecoderStep/ScheduledOutputTrainingHelperSample/Cast, decoder/while/Identity_2/_57)]]

Caused by op 'decoder/while/TensorArrayWrite_1/TensorArrayWriteV3', defined at:
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel_launcher.py", line 16, in <module>
    app.launch_new_instance()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 477, in start
    ioloop.IOLoop.instance().start()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 177, in start
    super(ZMQIOLoop, self).start()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tornado/ioloop.py", line 888, in start
    handler_func(fd_obj, events)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
    self._handle_recv()
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
    self._run_callback(callback, msg)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
    callback(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 235, in dispatch_shell
    handler(stream, idents, msg)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
    user_expressions, allow_stdin)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 196, in do_execute
    res = shell.run_cell(code, store_history=store_history, silent=silent)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 533, in run_cell
    return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2683, in run_cell
    interactivity=interactivity, compiler=compiler, result=result)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2787, in run_ast_nodes
    if self.run_code(code, result):
  File "/home/ppyht2/.local/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2847, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-16-aff58c38b4b8>", line 40, in <module>
    decoder,
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder.py", line 286, in dynamic_decode
    swap_memory=swap_memory)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2770, in while_loop
    result = context.BuildLoop(cond, body, loop_vars, shape_invariants)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2599, in BuildLoop
    pred, body, original_loop_vars, loop_vars, shape_invariants)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2549, in _BuildLoop
    body_result = body(*packed_vars_for_body)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder.py", line 274, in body
    outputs_ta, emit)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/util/nest.py", line 325, in map_structure
    structure[0], [func(*x) for x in entries])
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/util/nest.py", line 325, in <listcomp>
    structure[0], [func(*x) for x in entries])
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder.py", line 273, in <lambda>
    outputs_ta = nest.map_structure(lambda ta, out: ta.write(time, out),
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py", line 170, in wrapped
    return _add_should_use_warning(fn(*args, **kwargs))
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/tensor_array_ops.py", line 309, in write
    name=name)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 2353, in _tensor_array_write_v3
    name=name)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
    op_def=op_def)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2506, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "/home/ppyht2/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1269, in __init__
    self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): TensorArray dtype is int32 but Op is trying to write dtype bool.
	 [[Node: decoder/while/TensorArrayWrite_1/TensorArrayWriteV3 = TensorArrayWriteV3[T=DT_BOOL, _class=["loc:@decoder/while/BasicDecoderStep/ScheduledOutputTrainingHelperSample/Cast"], _device="/job:localhost/replica:0/task:0/cpu:0"](decoder/while/TensorArrayWrite_1/TensorArrayWriteV3/Enter, decoder/while/Identity/_55, decoder/while/BasicDecoderStep/ScheduledOutputTrainingHelperSample/Cast, decoder/while/Identity_2/_57)]]

In [ ]: