MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / __init__

Method __init__

tensorflow/python/ops/rnn_cell_impl.py:413–436  ·  view source on GitHub ↗
(self,
               num_units,
               activation=None,
               reuse=None,
               name=None,
               dtype=None,
               **kwargs)

Source from the content-addressed store, hash-verified

411 @deprecated(None, "This class is equivalent as tf.keras.layers.SimpleRNNCell,"
412 " and will be replaced by that in Tensorflow 2.0.")
413 def __init__(self,
414 num_units,
415 activation=None,
416 reuse=None,
417 name=None,
418 dtype=None,
419 **kwargs):
420 super(BasicRNNCell, self).__init__(
421 _reuse=reuse, name=name, dtype=dtype, **kwargs)
422 _check_supported_dtypes(self.dtype)
423 if context.executing_eagerly() and context.num_gpus() > 0:
424 logging.warn(
425 "%s: Note that this cell is not optimized for performance. "
426 "Please use tf.contrib.cudnn_rnn.CudnnRNNTanh for better "
427 "performance on GPU.", self)
428
429 # Inputs must be 2-dimensional.
430 self.input_spec = input_spec.InputSpec(ndim=2)
431
432 self._num_units = num_units
433 if activation:
434 self._activation = activations.get(activation)
435 else:
436 self._activation = math_ops.tanh
437
438 @property
439 def state_size(self):

Callers

nothing calls this directly

Calls 5

_check_supported_dtypesFunction · 0.85
executing_eagerlyMethod · 0.80
__init__Method · 0.45
num_gpusMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected