code: def loss_fn(y: tf.Tensor, x: tf.Tensor) -> tf.Tensor:
      y = tf.one_hot(tf.cast(y, tf.int32), input_dim)
      return tf.nn.softmax_cross_entropy_with_logits(y, x, axis=-1)
  
file_path: alibi-detect/alibi_detect/od/tests/test_llr.py
imports: from itertools import product
  import numpy
  import pytest
  import tensorflow
  from tensorflow.keras.layers import Dense, Input, LSTM
  from alibi_detect.od import LLR
  from alibi_detect.version import __version__
label_desc: Use image node_id 1 for calling a global function with example usage: loss_fn(y, x) and returns: tf