Trying to reproduce a small For-Loop in LibTorch JIT
PyTorch Forums
Trying to reproduce a small For-Loop in LibTorch JIT
Hello there, I was able to successfully represent the following Python code def test_if_else(condition: bool, input_val: Tensor) -> Tuple[int, Tensor]: status = 0 value = input_val * 2 if condition: status = 1 value = value + 10.0 else: status = -1 value = value - 5.0 return status, value as follows: // 1. Initialization auto cu = std::make_shared<torch:...
0 comments
No comments yet.