code: def get_test_data():
      batch_size = 2
      sequence_length = 3
      number_of_classes = 5
      logits = [
          tf.constant(i + 0.5, shape=[batch_size, number_of_classes])
          for i in range(sequence_length)
      ]
      logits = tf.stack(logits, axis=1)
      targets = [
          tf.constant(i, tf.int32, shape=[batch_size])
          for i in range(sequence_length)
      ]
      targets = tf.stack(targets, axis=1)
  
      weights = [
          tf.constant(1.0, shape=[batch_size])
          for _ in range(sequence_length)
      ]
      weights = tf.stack(weights, axis=1)
      # expected_loss = sparse_softmax_cross_entropy_with_logits(targets,
      # logits) where targets = [0, 1, 2],
      # and logits = [[0.5] * 5, [1.5] * 5, [2.5] * 5]
      expected_loss = 1.60944
      return (
          batch_size,
          sequence_length,
          number_of_classes,
          logits,
          targets,
          weights,
          expected_loss,
      )
  
file_path: addons/tensorflow_addons/seq2seq/tests/loss_test.py
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.seq2seq import loss
label_desc: Use image node_id 1 for calling a global function with example usage: get_test_data() and returns: batch_size,  sequence_length,  number_of_classes,  logits,  targets,  weights,  expected_loss