ttnn.indexed_fill

ttnn.indexed_fill = Operation(python_fully_qualified_name='ttnn.indexed_fill', function=<ttnn._ttnn.operations.data_movement.indexed_fill_t object>, preprocess_golden_function_inputs=<function default_preprocess_golden_function_inputs>, golden_function=None, postprocess_golden_function_outputs=<function default_postprocess_golden_function_outputs>, is_cpp_operation=True, is_experimental=False)

Replaces batch of input in input_b denoted by batch_ids into input_a.

Parameters:
  • batch_id (ttnn.Tensor) – the input tensor.

  • input_tensor_a (ttnn.Tensor) – the input tensor.

  • input_tensor_b (ttnn.Tensor) – the input tensor.

Keyword Arguments:
  • memory_config (ttnn.MemoryConfig, optional) – Memory configuration for the operation. Defaults to None.

  • dim (int, optional) – Dimension value. Defaults to 0.

  • queue_id (int, optional) – command queue id. Defaults to 0.

Returns:

ttnn.Tensor – the output tensor.

Example

>>> batch_id = ttnn.to_device(ttnn.from_torch(torch.tensor((1, 2), dtype=torch.UINT32)), device=device)
>>> input_a = ttnn.to_device(ttnn.from_torch(torch.tensor((1, 2), dtype=torch.bfloat16)), device=device)
>>> input_b = ttnn.to_device(ttnn.from_torch(torch.tensor((0, 1), dtype=torch.bfloat16)), device=device)
>>> output = ttnn.indexed_fill(batch_id, tensor1, tensor2)