This document is relevant for: Trn2, Trn3

nki.isa.nc_match_replace8#

nki.isa.nc_match_replace8(dst, data, vals, imm, dst_idx=None, name=None)[source]#

Replace first occurrence of each value in vals with imm in data using the Vector engine and return the replaced tensor. If dst_idx tile is provided, the indices of the matched values are written to dst_idx.

Parameters:
  • dst – output tile with replaced values

  • data – the data tensor to search and replace in

  • vals – tensor containing the 8 values per partition to match

  • imm – the immediate float value to replace matched values with

  • dst_idx – optional tile to store indices of matched values

This document is relevant for: Trn2, Trn3