Top

tensorbuilder.patches.rnn_utilities_patch module

from phi import utils
from tensorbuilder import TensorBuilder


@TensorBuilder.RegisterMethod("tb")
def rnn_placeholders_from_state(self, zero_state, name="rnn_state"):
    if isinstance(zero_state, tuple):
        return tuple([self.rnn_placeholders_from_state(substate, name=name) for substate in zero_state])
    else:
        return tf.placeholder(zero_state.dtype, shape=zero_state.get_shape(), name=name)

@TensorBuilder.RegisterMethod("tb")
def rnn_state_feed_dict(self, placeholders, values):
    return dict(zip(utils.flatten(placeholders), utils.flatten_list(values)))

Functions

def rnn_placeholders_from_state(

self, zero_state, name='rnn_state')

THIS METHOD IS AUTOMATICALLY GENERATED

builder.rnn_placeholders_from_state(*args, **kwargs)

It accepts the same arguments as tb.rnn_placeholders_from_state.

tb.rnn_placeholders_from_state

None
@TensorBuilder.RegisterMethod("tb")
def rnn_placeholders_from_state(self, zero_state, name="rnn_state"):
    if isinstance(zero_state, tuple):
        return tuple([self.rnn_placeholders_from_state(substate, name=name) for substate in zero_state])
    else:
        return tf.placeholder(zero_state.dtype, shape=zero_state.get_shape(), name=name)

def rnn_state_feed_dict(

self, placeholders, values)

THIS METHOD IS AUTOMATICALLY GENERATED

builder.rnn_state_feed_dict(*args, **kwargs)

It accepts the same arguments as tb.rnn_state_feed_dict.

tb.rnn_state_feed_dict

None
@TensorBuilder.RegisterMethod("tb")
def rnn_state_feed_dict(self, placeholders, values):
    return dict(zip(utils.flatten(placeholders), utils.flatten_list(values)))