class_docstr: Test cases for ftrl ops.
code: def _eval(
      self,
      var,
      accum,
      linear,
      grad,
      lr,
      l1,
      l2,
      l2_shrinkage=0,
      lr_power=1,
      multiply_linear_by_lr=False,
  ):
      dtype = np.float32
      var = np.array(var, dtype=dtype)
      accum = np.array(accum, dtype=dtype)
      linear = np.array(linear, dtype=dtype)
      grad = np.array(grad, dtype=dtype)
      use_v2 = bool(l2_shrinkage)
      with self.session() as session:
          with self.test_scope():
              lr = constant_op.constant(lr, dtype=dtype)
              l1 = constant_op.constant(l1, dtype=dtype)
              l2 = constant_op.constant(l2, dtype=dtype)
              l2_shrinkage = constant_op.constant(
                  l2_shrinkage, dtype=dtype
              )
              lr_power = constant_op.constant(lr_power, dtype=dtype)
              v_var = resource_variable_ops.ResourceVariable(
                  var, dtype=dtype
              )
              v_accum = resource_variable_ops.ResourceVariable(
                  accum, dtype=dtype
              )
              v_linear = resource_variable_ops.ResourceVariable(
                  linear, dtype=dtype
              )
              session.run(v_var.create)
              session.run(v_accum.create)
              session.run(v_linear.create)
              assert not (use_v2 and multiply_linear_by_lr)
              if use_v2:
                  session.run(
                      gen_training_ops.resource_apply_ftrl_v2(
                          v_var.handle,
                          v_accum.handle,
                          v_linear.handle,
                          grad,
                          lr,
                          l1,
                          l2,
                          l2_shrinkage,
                          lr_power,
                          multiply_linear_by_lr=multiply_linear_by_lr,
                      )
                  )
              else:
                  session.run(
                      gen_training_ops.resource_apply_ftrl(
                          v_var.handle,
                          v_accum.handle,
                          v_linear.handle,
                          grad,
                          lr,
                          l1,
                          l2,
                          lr_power,
                          multiply_linear_by_lr=multiply_linear_by_lr,
                      )
                  )
              return (
                  v_var.read_value().eval().reshape(var.shape),
                  v_accum.read_value().eval().reshape(accum.shape),
                  v_linear.read_value().eval().reshape(linear.shape),
              )
  
imports: import numpy
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gen_training_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 2 for calling the ResourceApplyFtrlTest obj's underlying member method code with example usage: obj._eval(var, accum, linear, grad, lr, l1, l2, l2_shrinkage, lr_power, multiply_linear_by_lr) and returns: v_var,  v_accum,  v_linear