@Henry_Chibueze, The  tensorflow version of cross entropy:  tf.nn.softmax_cross_entropy_with_logits allows me to pass 4D target with continuous values by passing axes argument representing class. I am trying to find pytorch version of this.