DLPrimitives
Public Member Functions | List of all members
dlprim::core::SliceCopy Class Reference

Class for copying a slice of an tensor. More...

#include <include/dlprim/core/common.hpp>

Public Member Functions

 SliceCopy (Context &ctx, DataType dtype=float_data)
 
void tensor_slice_copy (int dim, size_t slice, Tensor &target, size_t target_offset, Tensor &source, size_t source_offset, float target_scale, ExecutionContext const &e)
 Copy one part of tensor to another over single dimentsion dim, lets say if target and source are 4d tensors and dim == 1 then it is equivalent of following in numpy: More...
 

Detailed Description

Class for copying a slice of an tensor.

Member Function Documentation

void dlprim::core::SliceCopy::tensor_slice_copy ( int  dim,
size_t  slice,
Tensor target,
size_t  target_offset,
Tensor source,
size_t  source_offset,
float  target_scale,
ExecutionContext const &  e 
)

Copy one part of tensor to another over single dimentsion dim, lets say if target and source are 4d tensors and dim == 1 then it is equivalent of following in numpy:

target[:,taget_offset:target_offset + slice,:,:] *=target_scale
target[:,taget_offset:target_offset + slice,:,:] += source[:,source_offset:source_offset+slice,:,:]

The documentation for this class was generated from the following file: