Skip to content

Commit eb21dda

Browse files
Update release notes and fixing a unit test to align with recommendations in the notes.
1 parent 8cb0d6c commit eb21dda

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

RELEASENOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ Releases, starting with 9/2/2021, are listed with the most recent release at the
66

77
__Breaking Changes__:
88

9+
When creating a tensor from a 1-D array, and passing in a shape, there is now an ambiguity between the IList and Memory overloads of `torch.tensor()`. The ambiguity is resolved by removing the `dimensions` argument if it is redundant, or by an explicit cast to IList if it is not.
10+
911
__API Changes__:
1012

13+
#1326 Allow arrays used to create tensors to be larger than the tensor. Create tensors from a Memory instance<br/>
14+
1115
__Bug Fixes__:
1216

1317

test/TorchSharpTest/TestDataLoader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ public void DataLoaderTest1()
9696
using var dataloader = torch.utils.data.DataLoader(dataset, 2, false, torch.CPU);
9797
var iterator = dataloader.GetEnumerator();
9898
Assert.True(iterator.MoveNext());
99-
Assert.Equal(iterator.Current["data"], torch.tensor(rawArray: (IList<long>)new[]{1L, 1L}, dimensions: new[]{2L}, dtype: torch.ScalarType.Int32));
100-
Assert.Equal(iterator.Current["label"], torch.tensor(rawArray: (IList<long>)new[]{13L, 13L}, dimensions: new[]{2L}, dtype: torch.ScalarType.Int32));
101-
Assert.Equal(iterator.Current["index"].ToString(TensorStringStyle.Julia), torch.tensor(rawArray: (IList<long>)new[]{0L, 1L}, dimensions: new[]{2L}, dtype: torch.ScalarType.Int64).ToString(TensorStringStyle.Julia));
99+
Assert.Equal(iterator.Current["data"], torch.tensor(rawArray: new[]{1L, 1L}, dtype: torch.ScalarType.Int32));
100+
Assert.Equal(iterator.Current["label"], torch.tensor(rawArray: new[]{13L, 13L}, dtype: torch.ScalarType.Int32));
101+
Assert.Equal(iterator.Current["index"].ToString(TensorStringStyle.Julia), torch.tensor(rawArray: new[]{0L, 1L}, dtype: torch.ScalarType.Int64).ToString(TensorStringStyle.Julia));
102102
iterator.Dispose();
103103
}
104104

0 commit comments

Comments
 (0)