class_docstr: Computes Spearman's Rank Correlation Coefficient.
  
  Usage:
  >>> actuals = tf.constant([12, 2, 1, 12, 2], dtype=tf.int32)
  >>> preds = tf.constant([1, 4, 7, 1, 0], dtype=tf.int32)
  >>> m = tfa.metrics.SpearmansRank(0, 13, 0, 8)
  >>> m.update_state(actuals, preds)
  >>> m.result().numpy()
  -0.54073805
class_docstr_tok: ["Computes","Spearman","'s","Rank","Correlation","Coefficient",".","Usage",":",">",">",">","actuals","=","tf.constant","(","[","12",",","2",",","1",",","12",",","2","]",",","dtype=tf.int32",")",">",">",">","preds","=","tf.constant","(","[","1",",","4",",","7",",","1",",","0","]",",","dtype=tf.int32",")",">",">",">","m","=","tfa.metrics.SpearmansRank","(","0",",","13",",","0",",","8",")",">",">",">","m.update_state","(","actuals",",","preds",")",">",">",">","m.result","(",")",".numpy","(",")","-0.54073805"]
code: def result(self):
      nrow = tf.cast(self.nrow, tf.float32)
      ncol = tf.cast(self.ncol, tf.float32)
      n = tf.cast(self.n, tf.float32)
  
      nrow_ = tf.where(nrow > 0, nrow, -1.0)
      rrow = tf.cumsum(nrow, exclusive=True) + (nrow_ - n) / 2
      ncol_ = tf.where(ncol > 0, ncol, -1.0)
      rcol = tf.cumsum(ncol, exclusive=True) + (ncol_ - n) / 2
  
      rrow = rrow / tf.math.sqrt(tf.reduce_sum(nrow * tf.square(rrow)))
      rcol = rcol / tf.math.sqrt(tf.reduce_sum(ncol * tf.square(rcol)))
  
      m = tf.cast(self.m, tf.float32)
      corr = tf.matmul(tf.expand_dims(rrow, axis=0), m)
      corr = tf.matmul(corr, tf.expand_dims(rcol, axis=1))
      return tf.squeeze(corr)
  
imports: from abc import abstractmethod
  import numpy
  import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras.metrics import Metric
  from tensorflow_addons.utils.types import AcceptableDTypes
  from typeguard import typechecked
label_desc: Use image node_id 1 for calling the SpearmansRank obj's underlying member method code with example usage: obj.result() and returns: tf