docstr: tf.function correctly handles if statement when argument is Variable.
docstr_tok: ["tf.function","correctly","handles","if","statement","when","argument","is","Variable","."]
code: def test_with_tf_function_with_variables(self, autograph):
      """tf.function correctly handles if statement when argument is Variable."""
  
      layer = dropout.Dropout(rate=0.5)
      layer = tf.function(layer, autograph=autograph)
  
      inputs = tf.ones([2, 5, 3, 3, 3])
      expected = tf.zeros_like(inputs)
      is_training_variable = tf.Variable(False, trainable=False)
  
      for is_training in (True, False):
          is_training_variable.assign(is_training)
          outputs = layer(inputs, is_training_variable)
          self.assertEqual(outputs.shape, expected.shape)
  
file_path: sonnet/sonnet/src/dropout_test.py
imports: from absl.testing import parameterized
  import numpy
  from sonnet.src import dropout
  from sonnet.src import test_utils
  import tensorflow
label_desc: Use image node_id 5 for calling the DropoutTest obj's underlying member method code with example usage: obj.test_with_tf_function_with_variables(autograph) without return types