Function nvcvTensorReshape

Function Documentation

NVCVStatus nvcvTensorReshape(NVCVTensorHandle handle, int32_t rank, const int64_t *shape, NVCVTensorLayout layout, NVCVTensorHandle *out_handle)

Creates a view of a tensor with a different shape and layout.

Parameters:
  • handle[in] Tensor to create a view from.

    • Must not be NULL.

  • rank[in] Number of elements in the shape buffer argument.

    • Must be a number between 1 and NVCV_TENSOR_MAX_RANK

  • shape[in] New shape. Must point to a buffer with rank elements. Elements above actual number of dimensions will be ignored.

  • layout[in] New layout. Must have rank elements or be empty.

  • handle[out] Where the tensor instance handle will be written to.

    • Must not be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is invalid.

  • NVCV_SUCCESS – Operation executed successfully.