[RFC] API change: asnumpy -> numpy

Similar to the previous RFC that renames the TVMContext to Device, this RFC aims to make the TVM API be more consistent with other frameworks. We propose to rename the asnumpy API in the TVM NDArray to numpy followed by the convention adopted in the PyTorch Tensor and the TensorFlow Tensor.

Let me know if you have any concern to this API change. Thank you.

@tqchen @jroesch @junrushao1994 @comaniac @tkonolige


I am in favor of this change. APIs being consistent with other frameworks helps TVM adoption to new users :slight_smile: Thanks for bringing it up!

Thanks haichen for bringing this up. I agree it is a good change. We can introduce .numpy API, mark asnumpy as deprecated and remove in the next release

Definitely a good idea. I second Tianqi here with marking the old method as deprecated. I think there was a lot of confusion from users when we switch context → device without any deprecation warnings.


+1 for making the APIs consistent and display the deprecate warning.

I agree with the refactor, but +1 to the deprecation warning. The context to device refactor silently broke a lot of my personal testing code :smiley:

Yeah all seems good to me :+1:

+1 Great to see it consistent with Pytorch API.

1 Like

As per discussion, I will prepare the PR to change the API to numpy and add a deprecation warning message in the asnumpy.