8000 Actually fix TfLiteDelegate* pointer<->long interop · compnerd/tensorflow@127aae0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 127aae0

Browse files
jdduketensorflower-gardener
authored andcommitted
Actually fix TfLiteDelegate* pointer<->long interop
Use PyLong_AsVoidPtr. PiperOrigin-RevId: 252753868
1 parent d7a0333 commit 127aae0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tensorflow/lite/python/interpreter_wrapper/interpreter_wrapper.i

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ limitations under the License.
2626

2727

2828
%typemap(in) TfLiteDelegate* {
29-
auto pointer_as_long = PyLong_AsLong($input);
30-
static_assert(sizeof(pointer_as_long)>=sizeof(TfLiteDelegate*),
31-
"TFLiteDelegate must be representable as a long.");
32-
$1 = reinterpret_cast<TfLiteDelegate*>(pointer_as_long);
29+
$1 = reinterpret_cast<TfLiteDelegate*>(PyLong_AsVoidPtr($input));
3330
}
3431

3532

0 commit comments

Comments
 (0)
0