leezu commented on a change in pull request #19685:
URL: https://github.com/apache/incubator-mxnet/pull/19685#discussion_r581415947
##########
File path: .github/workflows/os_x_staticbuild.yml
##########
@@ -42,6 +42,12 @@ jobs:
run: |
python -m pip install --user -e python
+ - name: Build with Cython
+ run: |
+ cd python
+ python setup.py build_ext --inplace --with-cython
+ export MXNET_ENABLE_CYTHON=1
Review comment:
Should we use the Github actions env syntax to declare this variable in
the "Test project" step?
https://docs.github.com/en/actions/reference/environment-variables
##########
File path: include/mxnet/runtime/object.h
##########
@@ -54,11 +54,12 @@ enum TypeIndex {
kMXNetTensor = 1,
kMXNetClosure = 2,
kMXNetADT = 3,
- kRuntimeModule = 4,
Review comment:
What happened to kRuntimeModule?
##########
File path: src/api/cached_op_api.cc
##########
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file cached_op_api.cc
+ * \brief The API of function to invoke CachedOp in src/imperative/cached_op.cc
+ */
+#include <mxnet/api_registry.h>
+#include <mxnet/runtime/packed_func.h>
+#include <mxnet/runtime/container_ext.h>
+#include "../imperative/cached_op.h"
+#include "../imperative/cached_op_threadsafe.h"
+
+namespace mxnet {
+
+MXNET_REGISTER_GLOBAL("cached_op.invoke")
+.set_body([](runtime::MXNetArgs args, runtime::MXNetRetValue* ret) {
+ CachedOpPtr op_shared = *static_cast<CachedOpPtr*>(
+ static_cast<CachedOpHandle>(static_cast<void*>(args[0])));
Review comment:
Why 3 nested static_cast? Note that `typedef void *CachedOpHandle;`
This question also applies to the other locations where you do nested
static_cast.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]