Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/paddle/base/dygraph/tensor_patch_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,7 @@ def _get_c_dlpack_exchange_api():
return core.dlpack_exchange_api_ptr()
except Exception:
pass
# For tvm ffi 0.1.4 only, in tvm ffi 0.1.5+, replaced by `__dlpack_c_exchange_api__`
return core.dlpack_exchange_api_pycapsule()

if not hasattr(core, "eager"):
Expand Down Expand Up @@ -1652,7 +1653,9 @@ def _get_c_dlpack_exchange_api():
("__dlpack_device__", __dlpack_device__),
("get_device", get_device),
("__tvm_ffi_env_stream__", __tvm_ffi_env_stream__),
# For TVM FFI 0.1.0-0.1.4, Replaced by `__c_dlpack_exchange_api__` in TVM FFI 0.1.5+
("__c_dlpack_exchange_api__", _get_c_dlpack_exchange_api()),
("__dlpack_c_exchange_api__", core.dlpack_exchange_api_pycapsule()),
("device", device),
):
setattr(core.eager.Tensor, method_name, method)
Expand Down
2 changes: 1 addition & 1 deletion python/unittest_py/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ xdoctest==1.3.0
ubelt==1.3.3 # just for xdoctest
mypy==1.18.2
soundfile
apache-tvm-ffi==0.1.4
apache-tvm-ffi==0.1.5
graphviz
nvidia-ml-py3 ; platform_system != "Darwin"
1 change: 1 addition & 0 deletions test/dygraph_to_static/test_tensor_attr_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"__dlpack_device__",
"__tvm_ffi_env_stream__",
"__c_dlpack_exchange_api__",
"__dlpack_c_exchange_api__",
]
)
STATIC_ONLY_TENSOR_ATTRS_ALLOW_LIST = OrderedSet(
Expand Down
Loading