def export_ops(self, name)

def export_ops(self, name):
    """Exports ops to collections."""
    self._name = name
    ops = {util.with_prefix(self._name, "cost"): self._cost}
    if self._is_training:
        ops.update(lr=self._lr, new_lr=self._new_lr, lr_update=self._lr_update)
        if self._rnn_params:
            ops.update(rnn_params=self._rnn_params)
    for name, op in ops.items():
        tf.add_to_collection(name, op)
    self._initial_state_name = util.with_prefix(self._name, "initial")
    self._final_state_name = util.with_prefix(self._name, "final")
    util.export_state_tuples(self._initial_state, self._initial_state_name)
    util.export_state_tuples(self._final_state, self._final_state_name)

results matching ""

    No results matching ""