Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.cat is missing since update to PyTorch 1.13 #1293

Closed
sbrunk opened this issue Dec 19, 2022 · 3 comments
Closed

torch.cat is missing since update to PyTorch 1.13 #1293

sbrunk opened this issue Dec 19, 2022 · 3 comments
Labels

Comments

@sbrunk
Copy link
Contributor

sbrunk commented Dec 19, 2022

Before the update to PyTorch 1.13 in b2b8eb9, the PyTorch bindings included the following functions

@Namespace("at") public static native @ByVal Tensor cat(@ByVal TensorArrayRef tensors, @Cast("int64_t") long dim/*=0*/);
@Namespace("at") public static native @ByVal Tensor cat(@ByVal TensorArrayRef tensors);

as well as a few variants like cat_out, all coming from ATen/ops/cat.h, which has the following diff:

-TORCH_API inline at::Tensor cat(at::TensorList tensors, int64_t dim=0) {
+inline at::Tensor cat(const at::ITensorListRef & tensors, int64_t dim=0) {
    return at::_ops::cat::call(tensors, dim);
}

So the type changed from TensorList to ITensorListRef which seems to be skipped in the mappings:

"at::ITensorListRef", "std::array<c10::FunctionalityOffsetAndMask,c10::num_functionality_keys>").skip())

Could this be the reason why cat is not mapped anymore?

@saudet
Copy link
Member

saudet commented Dec 20, 2022

Good catch! Done in commit 10ddc85. Thanks

@sbrunk
Copy link
Contributor Author

sbrunk commented Dec 20, 2022

Thanks for adding! Could you perhaps re-trigger the CI? The windows build timed out and I think that prevented publishing the snapshots.

@sbrunk
Copy link
Contributor Author

sbrunk commented Dec 21, 2022

Works like a charm with the new snapshot. :)

val t = torch.Tensor(Seq(1,2,3))                                                                                                                                                                                                 
// t: Tensor[Int32] = dtype=int32, shape=[3], device=CPU 
// [1, 2, 3]
torch.cat(Seq(t,t))
// res0: Tensor[Int32] = dtype=int32, shape=[6], device=CPU 
// [1, 2, 3, 1, 2, 3]

So I think we can close this.

@sbrunk sbrunk closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants