(x: torch.Tensor)
| 208 | data = torch.rand((3, 4)) |
| 209 | |
| 210 | def func_cat(x: torch.Tensor): |
| 211 | boxes1 = Boxes(x) |
| 212 | boxes2 = Boxes(x) |
| 213 | # boxes3 = Boxes.cat([boxes1, boxes2]) # this is not supported by torchsript for now. |
| 214 | boxes3 = boxes1.cat([boxes1, boxes2]) |
| 215 | return boxes3 |
| 216 | |
| 217 | f = torch.jit.script(func_cat) |
| 218 | script_box = f(data) |