Using typeof() on a tf tensor only returns object.
Using isinstancof object, or isinstanceof tf.tensor, will generate syntax error of missing ) after argument list…
So, how to verify an object is a tf tensor on which we can apply tensor related operations?
import * as tf from "@tensorflow/tfjs";    
const a = tf.tensor([[1, 2], [3, 4]]);
console.log('type:', typeof(a));
// returns "object"