PyTorch
|
Provides a fluent API to construct tensors from external data. More...
#include <from_blob.h>
Public Types | |
using | ContextDeleter = DeleterFnPtr |
Public Member Functions | |
TensorMaker & | strides (OptionalIntArrayRef value) noexcept |
TensorMaker & | storage_offset (optional< int64_t > value) noexcept |
TensorMaker & | deleter (std::function< void(void *)> value) noexcept |
TensorMaker & | context (void *value, ContextDeleter deleter=nullptr) noexcept |
TensorMaker & | target_device (optional< Device > value) noexcept |
TensorMaker & | options (TensorOptions value) noexcept |
Tensor | make_tensor () |
Friends | |
TensorMaker | for_blob (void *data, IntArrayRef sizes) noexcept |
Provides a fluent API to construct tensors from external data.
The fluent API can be used instead of from_blob
functions in case the required set of parameters does not align with the existing overloads.
at::Tensor tensor = at::for_blob(data, sizes) .strides(strides) .context(context, [](void *ctx) { delete static_cast<Ctx*>(ctx); }) .options(...) .make_tensor();
using at::TensorMaker::ContextDeleter = DeleterFnPtr |
|
inlinenoexcept |
|
inlinenoexcept |
Tensor at::TensorMaker::make_tensor | ( | ) |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |