class_docstr: Dropout layer (specification key: `dropout`).
  
  Args:
      rate (parameter, 0.0 <= float < 1.0): Dropout rate
          (<span style="color:#C00000"><b>required</b></span>).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
class_docstr_tok: ["Dropout","layer","(","specification","key",":","`","dropout","`",")",".","Args",":","rate","(","parameter",",","0.0","<","=","float","<","1.0",")",":","Dropout","rate","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","name","(","string",")",":","Layer","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","internally","chosen",")",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def apply(self, *, x, deterministic):
      if self.rate.is_constant(value=0.0):
          return x
  
      else:
          rate = self.rate.value()
  
          def no_dropout():
              return x
  
          def apply_dropout():
              return tf.nn.dropout(x=x, rate=rate)
  
          zero = tf_util.constant(value=0.0, dtype="float")
          skip_dropout = tf.math.logical_or(
              x=deterministic, y=tf.math.equal(x=rate, y=zero)
          )
          return tf.cond(
              pred=skip_dropout,
              true_fn=no_dropout,
              false_fn=apply_dropout,
          )
  
imports: import math
  import random
  import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core import parameter_modules, TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import Layer, NondeterministicLayer
label_desc: Use image node_id 3 for calling the Dropout obj's underlying member method code with example usage: obj.apply() and returns: x, tf, x, tf