mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
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.
15 lines
286 B
C++
15 lines
286 B
C++
#include <Python.h>
|
|
#include <structmember.h>
|
|
|
|
#include <stdbool.h>
|
|
#include <TH/TH.h>
|
|
#include <libshm.h>
|
|
#include "THP.h"
|
|
#include "byte_order.h"
|
|
|
|
#include "generic/Storage.cpp"
|
|
#include <TH/THGenerateAllTypes.h>
|
|
|
|
#include "generic/StorageCopy.cpp"
|
|
#include <TH/THGenerateAllTypes.h>
|