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

Fast TensorAccessor #1396

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

haytham2597
Copy link

No description provided.

TorchSharp.sln Outdated Show resolved Hide resolved
src/TorchSharp/Utils/TensorAccessor.cs Outdated Show resolved Hide resolved
src/TorchSharp/Utils/TensorAccessor.cs Show resolved Hide resolved
src/TorchSharp/Utils/TensorAccessor.cs Outdated Show resolved Hide resolved
src/TorchSharp/Utils/TensorAccessor.cs Outdated Show resolved Hide resolved
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason sometime the test failed or success about TestLoadJIT_3() i noticed that the values is still so closest with so small difference so i put threshold.

var tt = tensor(v, t.shape, t.dtype);
Assert.Equal(0, t.storage_offset());
Assert.True(tt.equal(t).all().item<bool>());
}
Copy link
Author

@haytham2597 haytham2597 Nov 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need add more test like for example ToArray(18, 4) that is from index 18 with length 4. Or add ToArray(5) mean from index 5 to the numel. And some of CopyFrom, ToNDArray, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants