Skip to content

Commit a9d6095

Browse files
Bump the dotnet group in /docs/core/whats-new/snippets/dotnet-9/csharp with 3 updates (#43069)
* Bump the dotnet group Bumps the dotnet group in /docs/core/whats-new/snippets/dotnet-9/csharp with 3 updates: [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net), [System.Net.ServerSentEvents](https://github.com/dotnet/runtime) and [System.Numerics.Tensors](https://github.com/dotnet/runtime). Updates `Azure.Storage.Blobs` from 12.22.0-beta.1 to 12.22.2 - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](Azure/azure-sdk-for-net@Azure.Storage.Blobs_12.22.0-beta.1...Azure.Storage.Blobs_12.22.2) Updates `System.Net.ServerSentEvents` from 9.0.0-preview.6.24327.7 to 9.0.0-rc.2.24473.5 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](dotnet/runtime@9.0.0-preview.6.24327.7...v9.0.0-rc.2.24473.5) Updates `System.Numerics.Tensors` from 9.0.0-preview.5.24306.7 to 9.0.0-rc.2.24473.5 - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](dotnet/runtime@v9.0.0-preview.5.24306.7...v9.0.0-rc.2.24473.5) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet - dependency-name: System.Net.ServerSentEvents dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet - dependency-name: System.Numerics.Tensors dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dotnet ... Signed-off-by: dependabot[bot] <support@github.com> * fix build errors --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
1 parent 5809992 commit a9d6095

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.editorconfig

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ charset = utf-8-bom
2222
# Analyzers
2323
dotnet_analyzer_diagnostic.category-Security.severity = error
2424
dotnet_code_quality.ca1802.api_surface = private, internal
25+
# SYSLIB5001: Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
26+
dotnet_diagnostic.SYSLIB5001.severity = suggestion
2527

2628
# Miscellaneous style rules
2729
dotnet_sort_system_directives_first = true

docs/core/whats-new/snippets/dotnet-9/csharp/Program.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
//Channels.RunIt();
77
//RegularExpressions.RunIt();
88
//Collections.RunIt();
9-
Diagnostics.RunIt();
9+
//Diagnostics.RunIt();
10+
Tensors.RunIt();

docs/core/whats-new/snippets/dotnet-9/csharp/Project.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Azure.Storage.Blobs" Version="12.22.0-beta.1" />
11+
<PackageReference Include="Azure.Storage.Blobs" Version="12.22.2" />
1212
<PackageReference Include="Microsoft.ML.Tokenizers" Version="0.21.1" />
1313
<PackageReference Include="System.Memory" Version="4.5.5" />
14-
<PackageReference Include="System.Net.ServerSentEvents" Version="9.0.0-preview.6.24327.7" />
15-
<PackageReference Include="System.Numerics.Tensors" Version="9.0.0-preview.5.24306.7" />
14+
<PackageReference Include="System.Net.ServerSentEvents" Version="9.0.0-rc.2.24473.5" />
15+
<PackageReference Include="System.Numerics.Tensors" Version="9.0.0-rc.2.24473.5" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

docs/core/whats-new/snippets/dotnet-9/csharp/Tensors.cs

+9-10
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,44 @@ public static void RunIt()
77
{
88
// <SnippetTensor>
99
// Create a tensor (1 x 3).
10-
var t0 = Tensor.Create([1, 2, 3], [1, 3]); // [[1, 2, 3]]
10+
Tensor<int> t0 = Tensor.Create([1, 2, 3], [1, 3]); // [[1, 2, 3]]
1111

1212
// Reshape tensor (3 x 1).
13-
var t1 = t0.Reshape(3, 1); // [[1], [2], [3]]
13+
Tensor<int> t1 = t0.Reshape(3, 1); // [[1], [2], [3]]
1414

1515
// Slice tensor (2 x 1).
16-
var t2 = t1.Slice(1.., ..); // [[2], [3]]
16+
Tensor<int> t2 = t1.Slice(1.., ..); // [[2], [3]]
1717

1818
// Broadcast tensor (3 x 1) -> (3 x 3).
1919
// [
2020
// [ 1, 1, 1],
2121
// [ 2, 2, 2],
2222
// [ 3, 3, 3]
2323
// ]
24-
var t3 = Tensor.Broadcast(t1, [3, 3]);
24+
var t3 = Tensor.Broadcast<int>(t1, [3, 3]);
2525

2626
// Math operations.
2727
var t4 = Tensor.Add(t0, 1); // [[2, 3, 4]]
28-
var t5 = Tensor.Add(t0, t0); // [[2, 4, 6]]
28+
var t5 = Tensor.Add(t0.AsReadOnlyTensorSpan(), t0); // [[2, 4, 6]]
2929
var t6 = Tensor.Subtract(t0, 1); // [[0, 1, 2]]
30-
var t7 = Tensor.Subtract(t0, t0); // [[0, 0, 0]]
30+
var t7 = Tensor.Subtract(t0.AsReadOnlyTensorSpan(), t0); // [[0, 0, 0]]
3131
var t8 = Tensor.Multiply(t0, 2); // [[2, 4, 6]]
32-
var t9 = Tensor.Multiply(t0, t0); // [[1, 4, 9]]
32+
var t9 = Tensor.Multiply(t0.AsReadOnlyTensorSpan(), t0); // [[1, 4, 9]]
3333
var t10 = Tensor.Divide(t0, 2); // [[0.5, 1, 1.5]]
34-
var t11 = Tensor.Divide(t0, t0); // [[1, 1, 1]]
34+
var t11 = Tensor.Divide(t0.AsReadOnlyTensorSpan(), t0); // [[1, 1, 1]]
3535
// </SnippetTensor>
3636

3737
// <SnippetCosineSimilarity>
3838
ReadOnlySpan<float> vector1 = [1, 2, 3];
3939
ReadOnlySpan<float> vector2 = [4, 5, 6];
4040
Console.WriteLine(TensorPrimitives.CosineSimilarity(vector1, vector2));
41-
4241
// Prints 0.9746318
4342

4443
ReadOnlySpan<double> vector3 = [1, 2, 3];
4544
ReadOnlySpan<double> vector4 = [4, 5, 6];
4645
Console.WriteLine(TensorPrimitives.CosineSimilarity(vector3, vector4));
47-
4846
// Prints 0.9746318461970762
47+
4948
// </SnippetCosineSimilarity>
5049
}
5150
}

0 commit comments

Comments
 (0)