ttnn.prod

ttnn.prod = FastOperation(python_fully_qualified_name='ttnn.prod', function=<ttnn._ttnn.operations.reduction.prod_t object>, preprocess_golden_function_inputs=None, golden_function=None, postprocess_golden_function_outputs=None, is_cpp_operation=True, is_experimental=False)

Computes the prod function along specified dim or all dimensions on the input tensor.

\[\begin{split}prod(\\mathrm{input\\_tensor}_i)\end{split}\]
Args:

input_tensor (ttnn.Tensor): the input tensor. all_dimensions (bool, optional): prod along all dimensions. Defaults to False. dim (int, optional): Dimension to perform prod. Defaults to 0.

Keyword Args:

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

Returns:

List of ttnn.Tensor: the output tensor.

Example:

>>> tensor = ttnn.from_torch(torch.tensor((1, 2), dtype=torch.bfloat16), device=device)
>>> output = ttnn.prod(tensor)