44
55// ===-------------- OMTensor.h - OMTensor Declaration header --------------===//
66//
7- // Copyright 2019-2020 The IBM Research Authors.
7+ // Copyright 2019-2023 The IBM Research Authors.
88//
99// =============================================================================
1010//
@@ -90,7 +90,7 @@ extern "C" {
9090 *
9191 */
9292OM_EXTERNAL_VISIBILITY OMTensor *omTensorCreate (
93- void *data_ptr, int64_t *shape, int64_t rank, OM_DATA_TYPE dtype);
93+ void *data_ptr, const int64_t *shape, int64_t rank, OM_DATA_TYPE dtype);
9494
9595/* *
9696 * \brief Create an OMTensor with specified data pointer, shape, rank and
@@ -121,7 +121,7 @@ OM_EXTERNAL_VISIBILITY OMTensor *omTensorCreate(
121121 *
122122 */
123123OM_EXTERNAL_VISIBILITY OMTensor *omTensorCreateWithOwnership (void *data_ptr,
124- int64_t *shape, int64_t rank, OM_DATA_TYPE dtype, int64_t owning);
124+ const int64_t *shape, int64_t rank, OM_DATA_TYPE dtype, int64_t owning);
125125
126126/* *
127127 * Create an OMTensor with the specified shape, rank and element type,
@@ -141,7 +141,7 @@ OM_EXTERNAL_VISIBILITY OMTensor *omTensorCreateWithOwnership(void *data_ptr,
141141 *
142142 */
143143OM_EXTERNAL_VISIBILITY OMTensor *omTensorCreateEmpty (
144- int64_t *shape, int64_t rank, OM_DATA_TYPE dtype);
144+ const int64_t *shape, int64_t rank, OM_DATA_TYPE dtype);
145145
146146/* *
147147 * \brief Destroy the OMTensor struct.
@@ -179,7 +179,7 @@ OM_EXTERNAL_VISIBILITY void *omTensorGetDataPtr(const OMTensor *tensor);
179179 * @param tensor pointer to the OMTensor
180180 * @return pointer to the data shape array.
181181 */
182- OM_EXTERNAL_VISIBILITY int64_t *omTensorGetShape (const OMTensor *tensor);
182+ OM_EXTERNAL_VISIBILITY const int64_t *omTensorGetShape (const OMTensor *tensor);
183183
184184/* *
185185 * \brief OMTensor data shape setter.
@@ -195,7 +195,7 @@ OM_EXTERNAL_VISIBILITY int64_t *omTensorGetShape(const OMTensor *tensor);
195195 *
196196 * Set the data shape array of the OMTensor to the values in the input array.
197197 */
198- OM_EXTERNAL_VISIBILITY void omTensorSetShape (OMTensor *tensor, int64_t *shape);
198+ OM_EXTERNAL_VISIBILITY void omTensorSetShape (OMTensor *tensor, const int64_t *shape);
199199
200200/* *
201201 * \brief OMTensor data strides getter
@@ -209,7 +209,7 @@ OM_EXTERNAL_VISIBILITY void omTensorSetShape(OMTensor *tensor, int64_t *shape);
209209 * @param tensor pointer to the OMTensor
210210 * @return pointer to the data strides array.
211211 */
212- OM_EXTERNAL_VISIBILITY int64_t *omTensorGetStrides (const OMTensor *tensor);
212+ OM_EXTERNAL_VISIBILITY const int64_t *omTensorGetStrides (const OMTensor *tensor);
213213
214214/* *
215215 * \brief OMTensor data strides setter
@@ -226,7 +226,7 @@ OM_EXTERNAL_VISIBILITY int64_t *omTensorGetStrides(const OMTensor *tensor);
226226 * Set the data strides array of the OMTensor to the values in the input array.
227227 */
228228OM_EXTERNAL_VISIBILITY void omTensorSetStrides (
229- OMTensor *tensor, int64_t *stride);
229+ OMTensor *tensor, const int64_t *stride);
230230
231231/* *
232232 * \brief OMTensor data strides setter with stride values from PyArray strides
@@ -247,7 +247,7 @@ OM_EXTERNAL_VISIBILITY void omTensorSetStrides(
247247 * Set the data strides array of the OMTensor to the values in the input array.
248248 */
249249OM_EXTERNAL_VISIBILITY void omTensorSetStridesWithPyArrayStrides (
250- OMTensor *tensor, int64_t *stridesInBytes);
250+ OMTensor *tensor, const int64_t *stridesInBytes);
251251
252252/* *
253253 * \brief OMTensor data type getter
0 commit comments