Home / Class/ PytorchHostTests Class — pytorch Architecture

PytorchHostTests Class — pytorch Architecture

Architecture documentation for the PytorchHostTests class in PytorchHostTests.java from the pytorch codebase.

Entity Profile

Source Code

android/pytorch_android/src/androidTest/java/org/pytorch/PytorchHostTests.java lines 10–25

public class PytorchHostTests extends PytorchTestBase {

  @Override
  protected Module loadModel(String path) throws IOException {
    return Module.load(assetFilePath(path));
  }

  private String assetFilePath(String assetName) throws IOException {
    Path tempFile = Files.createTempFile("test", ".pt");
    try (InputStream resource =
        Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("test.pt"))) {
      Files.copy(resource, tempFile, StandardCopyOption.REPLACE_EXISTING);
    }
    return tempFile.toAbsolutePath().toString();
  }
}

Analyze Your Own Codebase

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

Try Supermodel Free