Home / Function/ testEmptyShape() — pytorch Function Reference

testEmptyShape() — pytorch Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

android/pytorch_android/src/androidTest/java/org/pytorch/PytorchTestBase.java lines 283–293

  @Test
  public void testEmptyShape() throws IOException {
    final Module module = loadModel(TEST_MODULE_ASSET_NAME);
    final long someNumber = 43;
    final IValue input = IValue.from(Tensor.fromBlob(new long[] {someNumber}, new long[] {}));
    final IValue output = module.runMethod("newEmptyShapeWithItem", input);
    assertTrue(output.isTensor());
    Tensor value = output.toTensor();
    assertArrayEquals(new long[] {}, value.shape());
    assertArrayEquals(new long[] {someNumber}, value.getDataAsLongArray());
  }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testEmptyShape() do?
testEmptyShape() is a function in the pytorch codebase.
What does testEmptyShape() call?
testEmptyShape() 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