Skip to content

Commit aee1790

Browse files
committed
use Preview 6
1 parent d3075bd commit aee1790

File tree

16 files changed

+25
-21
lines changed

16 files changed

+25
-21
lines changed

BasicMath/BasicMath.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp2.0</TargetFramework>
66
<LangVersion>latest</LangVersion>
7+
<RootNamespace>Gradient.Samples</RootNamespace>
78
</PropertyGroup>
89

910
<ItemGroup>
10-
<PackageReference Include="Gradient" Version="0.1.10-tech-preview5.1.1" />
11+
<PackageReference Include="Gradient" Version="0.1.10-tech-preview6" />
1112
</ItemGroup>
1213

1314
</Project>

BasicMath/BasicMathProgram.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace BasicMath {
1+
namespace Gradient.Samples {
22
using System;
33
using Gradient;
44
using tensorflow;

CharRNN/CharRNN.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="CommandLineParser" Version="2.3.0" />
18-
<PackageReference Include="Gradient" Version="0.1.10-tech-preview5.1.1" />
18+
<PackageReference Include="Gradient" Version="0.1.10-tech-preview6" />
1919
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
2020
</ItemGroup>
2121

CharRNN/CharRNNModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CharRNNModel {
1616
readonly Random random = new Random();
1717
readonly CharRNNModelParameters parameters;
1818
readonly Func<int, RNNCell> cellFactory;
19-
readonly PythonList<RNNCell> cells = new PythonList<RNNCell>();
19+
readonly List<RNNCell> cells = new List<RNNCell>();
2020
readonly RNNCell rnn;
2121
internal readonly dynamic inputData;
2222
internal readonly seq2seqState initialState;
@@ -65,8 +65,8 @@ public CharRNNModel(CharRNNModelParameters parameters, bool training = true) {
6565
if (training && parameters.KeepOutputProbability < 1)
6666
input = tf.nn.dropout(input, parameters.KeepOutputProbability);
6767

68-
PythonList<Tensor> inputs = tf.split(input, parameters.SeqLength, axis: 1);
69-
inputs = inputs.Select(i => (Tensor)tf.squeeze(i, axis: 1)).ToPythonList();
68+
IList<Tensor> inputs = tf.split(input, parameters.SeqLength, axis: 1);
69+
inputs = inputs.Select(i => (Tensor)tf.squeeze(i, axis: 1)).ToList();
7070

7171
dynamic Loop(dynamic prev, dynamic _) {
7272
prev = tf.matmul(prev, softmax_W) + softmax_b;
@@ -78,7 +78,7 @@ dynamic Loop(dynamic prev, dynamic _) {
7878
initial_state: this.initialState.Items(),
7979
cell: this.rnn,
8080
loop_function: training ? null : PythonFunctionContainer.Of(new Func<dynamic, dynamic, dynamic>(Loop)), scope: "rnnlm");
81-
var outputs = decoder.Item1;
81+
IList<Tensor> outputs = decoder.Item1;
8282
var lastState = (seq2seqState)decoder.Item2;
8383
dynamic contatenatedOutputs = tf.concat(outputs, 1);
8484
var output = tensorflow.tf.reshape(contatenatedOutputs, new[] { -1, parameters.RNNSize });

CharRNN/CharRNNUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void CreateBatches() {
6767
if (this.batchCount == 0)
6868
throw new ArgumentException();
6969

70-
this.tensor = this.tensor[..this.batchCount * this.batchSize * this.seqLength-1];
70+
this.tensor = this.tensor[..(this.batchCount * this.batchSize * this.seqLength-1)];
7171
_ArrayLike xdata = this.tensor;
7272
_ArrayLike ydata = np.copy(this.tensor);
7373
ydata[..^1] = xdata[1..];

FSharp/BasicMathF/BasicMathF.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="FSharp.Interop.Dynamic" Version="4.0.3.130" />
14-
<PackageReference Include="Gradient" Version="0.1.10-tech-preview5.1.1" />
14+
<PackageReference Include="Gradient" Version="0.1.10-tech-preview6" />
1515
</ItemGroup>
1616

1717
</Project>

FSharp/FashionMnistF/FashionMnistF.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="FSharp.Interop.Dynamic" Version="4.0.3.130" />
14-
<PackageReference Include="Gradient" Version="0.1.10-tech-preview5.1.1" />
14+
<PackageReference Include="Gradient" Version="0.1.10-tech-preview6" />
1515
</ItemGroup>
1616
</Project>

FashionMnistClassification/FashionMnistClassification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Gradient.Examples {
1+
namespace Gradient.Samples {
22
using System;
33
using System.Diagnostics;
44
using numpy;

FashionMnistClassification/FashionMnistClassification.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<TargetFramework>netcoreapp2.0</TargetFramework>
66
<LangVersion>latest</LangVersion>
77
<CodeAnalysisRuleSet>FashionMnistClassification.ruleset</CodeAnalysisRuleSet>
8+
<RootNamespace>Gradient.Samples</RootNamespace>
89
</PropertyGroup>
910

1011
<ItemGroup>
11-
<PackageReference Include="Gradient" Version="0.1.10-tech-preview5.1.1" />
12+
<PackageReference Include="Gradient" Version="0.1.10-tech-preview6" />
1213
</ItemGroup>
1314

1415
</Project>

GPT-2/GPT-2.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="CsvHelper" Version="12.1.2" />
24-
<PackageReference Include="Gradient" Version="0.1.10-tech-preview5.1.1" />
24+
<PackageReference Include="Gradient" Version="0.1.10-tech-preview6" />
2525
<PackageReference Include="ManyConsole.CommandLineUtils" Version="1.0.3-alpha" />
2626
<PackageReference Include="morelinq" Version="3.1.0" />
2727
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />

0 commit comments

Comments
 (0)