Home / Function/ testListIntSumReturnTuple() — pytorch Function Reference

testListIntSumReturnTuple() — pytorch Function Reference

Architecture documentation for the testListIntSumReturnTuple() function in PytorchTestBase.java from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  4ee753ff_ee1c_c414_22b5_eb57f28eae17["testListIntSumReturnTuple()"]
  9f728842_eeeb_dcbf_a87a_1decf4b380f8["loadModel()"]
  4ee753ff_ee1c_c414_22b5_eb57f28eae17 -->|calls| 9f728842_eeeb_dcbf_a87a_1decf4b380f8
  style 4ee753ff_ee1c_c414_22b5_eb57f28eae17 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

android/pytorch_android/src/androidTest/java/org/pytorch/PytorchTestBase.java lines 153–178

  @Test
  public void testListIntSumReturnTuple() throws IOException {
    final Module module = loadModel(TEST_MODULE_ASSET_NAME);

    for (int n : new int[] {0, 1, 128}) {
      long[] a = new long[n];
      long sum = 0;
      for (int i = 0; i < n; i++) {
        a[i] = i;
        sum += a[i];
      }
      final IValue input = IValue.listFrom(a);
      assertTrue(input.isLongList());

      final IValue output = module.runMethod("listIntSumReturnTuple", input);

      assertTrue(output.isTuple());
      assertTrue(2 == output.toTuple().length);

      IValue output0 = output.toTuple()[0];
      IValue output1 = output.toTuple()[1];

      assertArrayEquals(a, output0.toLongList());
      assertTrue(sum == output1.toLong());
    }
  }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testListIntSumReturnTuple() do?
testListIntSumReturnTuple() is a function in the pytorch codebase.
What does testListIntSumReturnTuple() call?
testListIntSumReturnTuple() calls 1 function(s): loadModel.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free