xref: /aosp_15_r20/external/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack/src/operator-delete.c (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 /*
2  * Copyright (c) Facebook, Inc. and its affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #include <stdlib.h>
10 
11 #include <pytorch_qnnpack.h>
12 #include <qnnpack/operator.h>
13 
pytorch_qnnp_delete_operator(pytorch_qnnp_operator_t op)14 enum pytorch_qnnp_status pytorch_qnnp_delete_operator(
15     pytorch_qnnp_operator_t op) {
16   if (op == NULL) {
17     return pytorch_qnnp_status_invalid_parameter;
18   }
19 
20   free(op->indirection_buffer);
21   free(op->packed_weights);
22   free(op->a_sum);
23   free(op->zero_buffer);
24   free(op->lookup_table);
25   free(op);
26   return pytorch_qnnp_status_success;
27 }
28