Skip to content

Tensor.StdDev vs TensorPrimitivers.StdDev differences for Complex input #116133

Open
@lilinus

Description

@lilinus

Description

There is a difference on how standard deviation is calculated for Complex numbers.

Reproduction Steps

var arr = new Complex[] { new(1, 2), new(3, 4) };
var tensor = Tensor.Create(arr);
Console.WriteLine(TensorPrimitives.StdDev(arr));
Console.WriteLine(Tensor.StdDev(tensor.AsReadOnlyTensorSpan()));

Expected behavior

Output:

<1,4142135623730951; 0>
<1,4142135623730951; 0>

Actual behavior

Output:

<1,4142135623730951; 0>
<1; 1>

Regression?

No response

Known Workarounds

No response

Configuration

10.0.0-preview.4

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions