(self,
num_units,
activation=None,
reuse=None,
kernel_initializer=None,
bias_initializer=None,
name=None,
dtype=None,
**kwargs)
| 510 | @deprecated(None, "This class is equivalent as tf.keras.layers.GRUCell," |
| 511 | " and will be replaced by that in Tensorflow 2.0.") |
| 512 | def __init__(self, |
| 513 | num_units, |
| 514 | activation=None, |
| 515 | reuse=None, |
| 516 | kernel_initializer=None, |
| 517 | bias_initializer=None, |
| 518 | name=None, |
| 519 | dtype=None, |
| 520 | **kwargs): |
| 521 | super(GRUCell, self).__init__( |
| 522 | _reuse=reuse, name=name, dtype=dtype, **kwargs) |
| 523 | _check_supported_dtypes(self.dtype) |
| 524 | |
| 525 | if context.executing_eagerly() and context.num_gpus() > 0: |
| 526 | logging.warn( |
| 527 | "%s: Note that this cell is not optimized for performance. " |
| 528 | "Please use tf.contrib.cudnn_rnn.CudnnGRU for better " |
| 529 | "performance on GPU.", self) |
| 530 | # Inputs must be 2-dimensional. |
| 531 | self.input_spec = input_spec.InputSpec(ndim=2) |
| 532 | |
| 533 | self._num_units = num_units |
| 534 | if activation: |
| 535 | self._activation = activations.get(activation) |
| 536 | else: |
| 537 | self._activation = math_ops.tanh |
| 538 | self._kernel_initializer = initializers.get(kernel_initializer) |
| 539 | self._bias_initializer = initializers.get(bias_initializer) |
| 540 | |
| 541 | @property |
| 542 | def state_size(self): |
nothing calls this directly
no test coverage detected