Skip to content

Add Storage.from_buffer#9

Merged
soumith merged 1 commit intopytorch:masterfrom
colesbury:develop
Sep 7, 2016
Merged

Add Storage.from_buffer#9
soumith merged 1 commit intopytorch:masterfrom
colesbury:develop

Conversation

@colesbury
Copy link
Member

@colesbury colesbury commented Sep 7, 2016

The from_buffer is similar to numpy's frombuffer. It decodes a Python
buffer object into a Storage object. For byte and char storages, it
simply copies the bytes.

@soumith
Copy link
Collaborator

soumith commented Sep 7, 2016

THPByteOrder byte_order;
if (strcmp(byte_order_str, "native") == 0) {
byte_order = THP_nativeByteOrder();
} else if (strcmp(byte_order_str, "be") == 0) {

This comment was marked as off-topic.

@colesbury colesbury changed the title Add Storage.frombuffer Add Storage.from_buffer Sep 7, 2016
@soumith soumith closed this Sep 7, 2016
@soumith soumith reopened this Sep 7, 2016
@soumith soumith closed this Sep 7, 2016
@soumith soumith reopened this Sep 7, 2016
@soumith
Copy link
Collaborator

soumith commented Sep 7, 2016

ok tests pass. @apaszke good to go?

@apaszke
Copy link
Contributor

apaszke commented Sep 7, 2016

It still gives some compiler warnings. @colesbury could you please take a look?

@colesbury
Copy link
Member Author

(Fixed build warning)

The from_buffer is similar to numpy's frombuffer. It decodes a Python
buffer object into a Storage object. For byte and char storages, it
simply copies the bytes.
@colesbury
Copy link
Member Author

I have no idea what I'm doing

@iateadonut iateadonut mentioned this pull request Sep 4, 2023
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.

4 participants