Add a build method to DropoutWrapperBase that passes through to the wrapped cell.

This enables building of cells that have been wrapped with a dropout wrapper.

PiperOrigin-RevId: 265986982
This commit is contained in:
RJ Skerry-Ryan 2019-08-28 13:58:34 -07:00 committed by TensorFlower Gardener
parent fee62e2186
commit 804eb6e03f
2 changed files with 5 additions and 1 deletions

View File

@ -194,6 +194,10 @@ class DropoutWrapperBase(object):
def output_size(self):
return self.cell.output_size
def build(self, inputs_shape):
self.cell.build(inputs_shape)
self.built = True
def zero_state(self, batch_size, dtype):
with ops.name_scope(type(self).__name__ + "ZeroState", values=[batch_size]):
return self.cell.zero_state(batch_size, dtype)

View File

@ -160,7 +160,7 @@ tf_class {
}
member_method {
name: "build"
argspec: "args=[\'self\', \'_\'], varargs=None, keywords=None, defaults=None"
argspec: "args=[\'self\', \'inputs_shape\'], varargs=None, keywords=None, defaults=None"
}
member_method {
name: "call"