diff options
Diffstat (limited to 'pseudocode/library/variable_tensor_allocate.tosac')
-rw-r--r-- | pseudocode/library/variable_tensor_allocate.tosac | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pseudocode/library/variable_tensor_allocate.tosac b/pseudocode/library/variable_tensor_allocate.tosac new file mode 100644 index 0000000..4ac83e7 --- /dev/null +++ b/pseudocode/library/variable_tensor_allocate.tosac @@ -0,0 +1,19 @@ +// +// This confidential and proprietary software may be used only as +// authorised by a licensing agreement from ARM Limited +// (C) COPYRIGHT 2020-2024 ARM Limited +// ALL RIGHTS RESERVED +// The entire notice above must be reproduced on all authorised +// copies and copies may only be made to the extent permitted +// by a licensing agreement from ARM Limited. + +tensor_t* variable_tensor_allocate<in_t>(shape_t shape, int32_t uid) { + size_t size = tensor_size(shape); + tensor_t *allocated_tensor = new tensor_t; + allocated_tensor->data = new in_t[size]; + allocated_tensor->uid = uid; + allocated_tensor->is_written = false; + allocated_tensor->shape = shape; + allocated_tensor->type = in_t; + return allocated_tensor; +} |