Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Numerics.Tensors Inconsistent TryFlattenTo & TryBroadcastTo vs TryCopyTo #106537

Closed
soerenwolfers opened this issue Aug 16, 2024 · 3 comments

Comments

@soerenwolfers
Copy link

Description

TryFlattenTo and TryBroadcastTo throw when destination is too short, TryCopyTo returns false.

Reproduction Steps

using System.Diagnostics.CodeAnalysis;
using System.Numerics.Tensors;

namespace ConsoleApp1;

public abstract class Program
{
	[Experimental("SYSLIB5001")]
	public static void Main()
	{

		new TensorSpan<double>(new double[1]).TryCopyTo(Array.Empty<double>());
		new TensorSpan<double>(new double[1]).TryFlattenTo(Array.Empty<double>());
	}
}

Expected behavior

Return false; never throw.

Actual behavior

ArgumentException

Regression?

No response

Known Workarounds

No response

Configuration

.Net8, Ubuntu22, x64

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Aug 16, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

@soerenwolfers soerenwolfers changed the title System.Numerics.Tensors Inconsistent TryFlattenTo&TryBroadcastTo vs TryCopyTo System.Numerics.Tensors Inconsistent TryFlattenTo & TryBroadcastTo vs TryCopyTo Aug 16, 2024
@stephentoub stephentoub added this to the 9.0.0 milestone Aug 16, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Aug 16, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics-tensors
See info in area-owners.md if you want to be subscribed.

@jeffhandley
Copy link
Member

This was fixed by @michaelgsharp in #107852 and backported to .NET 9 in #108282.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants