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

Support for basic THFile operations. #54

Merged
merged 17 commits into from
Nov 8, 2018
Merged

Support for basic THFile operations. #54

merged 17 commits into from
Nov 8, 2018

Conversation

NiklasGustafsson
Copy link
Contributor

@NiklasGustafsson NiklasGustafsson commented Nov 6, 2018

With this PR, support for MemoryFile and DiskFile is introduced.

@NiklasGustafsson
Copy link
Contributor Author

Odd -- it's not re-running the checks.

TorchSharp.sln Show resolved Hide resolved
TorchSharp.sln Show resolved Hide resolved
TorchSharp/DiskFile.cs Outdated Show resolved Hide resolved
TorchSharp/FileOperations.cs Outdated Show resolved Hide resolved
TorchSharp/FileOperations.cs Outdated Show resolved Hide resolved
TorchSharp/FileOperations.cs Outdated Show resolved Hide resolved
/// <summary>
/// The storage class provides a mechanism to access the underlying data representation for memory files.
/// </summary>
public class CharStorage : IDisposable {
Copy link
Contributor

Choose a reason for hiding this comment

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

So my understanding is that CharStorage is used here while the other type of storages are used to back a tensor. Is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's what the C interface is using for memory files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Storages now are in 2 different files. Should we do as in Torch where all storages classes are in one file? This can be solved in a separate PR (related to #50?)

TorchSharp/TorchFiles.cs Show resolved Hide resolved
</Compile>
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Service tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why it keeps coming back. I've removed it before.

TorchSharp/DiskFile.cs Outdated Show resolved Hide resolved
@migueldeicaza
Copy link
Contributor

This seems to be using two different set of indentation styles in P/Invoke declarations.

@NiklasGustafsson
Copy link
Contributor Author

@migueldeicaza, are you referring to the placement of the [DllImport] attribute? The one-line format came about because I copied code from C, and then did a global replace. The latest update should have this addressed, with two lines for each declaration.

If you're referring to something else, please explain.

TorchSharp.sln Show resolved Hide resolved
TorchSharp/FileOperations.cs Outdated Show resolved Hide resolved
TorchSharp/TorchFiles.cs Show resolved Hide resolved
/// <summary>
/// The storage class provides a mechanism to access the underlying data representation for memory files.
/// </summary>
public class CharStorage : IDisposable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Storages now are in 2 different files. Should we do as in Torch where all storages classes are in one file? This can be solved in a separate PR (related to #50?)

@NiklasGustafsson
Copy link
Contributor Author

Are we good with this PR now?

@interesaaat interesaaat merged commit d1bb43f into dotnet:master Nov 8, 2018
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.

3 participants