ttnn.mse_loss
- ttnn.mse_loss = Operation(python_fully_qualified_name='ttnn.mse_loss', function=<ttnn._ttnn.operations.loss.mse_loss_t object>, preprocess_golden_function_inputs=<function default_preprocess_golden_function_inputs>, golden_function=<function _golden_function_mse_loss>, postprocess_golden_function_outputs=<function default_postprocess_golden_function_outputs>, is_cpp_operation=True, is_experimental=False)
-
Returns mean squared error loss function for input_reference and input_prediction
- Parameters:
-
input_reference (ttnn.Tensor) – the input tensor.
input_prediction (ttnn.Tensor) – the input tensor.
- Keyword Arguments:
-
reduction (bool, optional) – Loss Reduction Mode. Defaults to None.
output_tensor (ttnn.Tensor, optional) – Preallocated output tensor. Defaults to None.
memory_config (ttnn.MemoryConfig, optional) – Memory configuration for the operation. Defaults to None.
queue_id (int, optional) – command queue id. Defaults to 0.
- Returns:
-
ttnn.Tensor – the output tensor.
Example
>>> input_reference = ttnn.to_device(ttnn.from_torch(torch.tensor((1, 2), dtype=torch.bfloat16)), device=device) >>> input_prediction = ttnn.to_device(ttnn.from_torch(torch.tensor((1, 2), dtype=torch.bfloat16)), device=device) >>> output = ttnn.mse_loss(input_reference, input_prediction, reduction)