Function deepviewrt_sys::nn_tensor_padding
source · pub unsafe extern "C" fn nn_tensor_padding(
tensor: *mut NNTensor,
padtype: *const c_char,
window: *const i32,
stride: *const i32,
dilation: *const i32,
padded_shape: *mut i32,
paddings: *mut i32
) -> NNErrorExpand description
nn_tensor_padding calculates the paddings for the given tensor, padtype, window, stride, and dilation given n_dims being queried from the tensor’s nn_tensor_dims().
The paddings pointer must point to an array of 2 * n_dims elements into which the function will write the head/tail padding tuples for each of the n_dims provided dimensions. The padded_shape parameter must point to an array of n_dims elemens which will receive the output (padded) shape.
The padtype can be “VALID” or “SAME”. When padtype is “SAME” padded_shape will equal the shape of the input tensor and the paddings will be provided to achieve this shape. When padtype is “VALID” then paddings will be all zeros and the padded_shape will provide the target output shape given the provided parameters.
@public @memberof NNTensor @since 2.3