Dragon - C++ API
A Computation Graph Virtual Machine Based Deep Learning Framework
Namespaces | Macros | Functions
pad_op.cc File Reference
#include "core/workspace.h"
#include "utils/op_kernel.h"
#include "utils/math_functions.h"
#include "operators/array/pad_op.h"

Namespaces

 dragon
 

Macros

#define TENSOR_FROM_VEC(tensor, vec, T)
 

Functions

 dragon::DEPLOY_CPU (Pad)
 
 dragon::DEPLOY_CUDA (Pad)
 
 dragon::DEPLOY_CPU (PadGradient)
 
 dragon::DEPLOY_CUDA (PadGradient)
 
 dragon::NumInputs (1) .NumOutputs(1) .Inplace(
 
 dragon::REGISTER_GRADIENT (Pad, GradientMaker)
 

Macro Definition Documentation

◆ TENSOR_FROM_VEC

#define TENSOR_FROM_VEC (   tensor,
  vec,
 
)
Value:
{ \
tensor.Reshape({ (int64_t)vec.size() }); \
auto* data = tensor.template mutable_data<T, CPUContext>(); \
for (int i = 0; i < vec.size(); i++) data[i] = (T)vec[i]; \
}