Skip to content

Commit f80150f

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Custom ops API small fixes (#2936)
Summary: Fix the way we use `at::from_blob()` and add proper namespace to `CompileTimeFunctionPointer` so to not confused with `at::CompileTimeFunctionPointer`. Differential Revision: D55907751
1 parent f634ed8 commit f80150f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

extension/aten_util/make_aten_functor_from_et_functor.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ struct type_convert<
149149
}
150150
c10::ScalarType scalar_type =
151151
static_cast<c10::ScalarType>(val.scalar_type());
152-
converted =
153-
at::from_blob(val.mutable_data_ptr(), val.numel(), sizes, scalar_type);
152+
converted = at::from_blob(val.mutable_data_ptr(), sizes, scalar_type);
154153
}
155154
ATensor call() {
156155
return converted;

extension/aten_util/targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def define_common_targets():
2727
],
2828
exported_deps = [
2929
"//executorch/extension/kernel_util:kernel_util",
30+
"//executorch/extension/runner_util:managed_tensor",
3031
"//executorch/runtime/core:core",
3132
"//executorch/runtime/core:evalue",
3233
"//executorch/runtime/core/exec_aten:lib",

extension/kernel_util/meta_programming.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct is_compile_time_function_pointer<
4949
CompileTimeFunctionPointer<FuncType, func_ptr>> : std::true_type {};
5050

5151
#define EXECUTORCH_FN_TYPE(func) \
52-
CompileTimeFunctionPointer< \
52+
::torch::executor::CompileTimeFunctionPointer< \
5353
std::remove_pointer_t<std::remove_reference_t<decltype(func)>>, \
5454
func>
5555
#define EXECUTORCH_FN(func) EXECUTORCH_FN_TYPE(func)()

0 commit comments

Comments
 (0)