changes to appi semantics to provide tensor index to function; added sparse map2 operation