Home / Function/ testChannelsLast3d() — pytorch Function Reference

testChannelsLast3d() — pytorch Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  72f0c23d_afad_bcea_543f_79582b5d361b["testChannelsLast3d()"]
  9f728842_eeeb_dcbf_a87a_1decf4b380f8["loadModel()"]
  72f0c23d_afad_bcea_543f_79582b5d361b -->|calls| 9f728842_eeeb_dcbf_a87a_1decf4b380f8
  85d31af6_c650_49cb_5d35_da29aa71d31c["assertIValueTensor()"]
  72f0c23d_afad_bcea_543f_79582b5d361b -->|calls| 85d31af6_c650_49cb_5d35_da29aa71d31c
  style 72f0c23d_afad_bcea_543f_79582b5d361b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

android/pytorch_android/src/androidTest/java/org/pytorch/PytorchTestBase.java lines 331–346

  @Test
  public void testChannelsLast3d() throws IOException {
    long[] shape = new long[] {1, 2, 2, 2, 2};
    long[] dataNCHWD = new long[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
    long[] dataNHWDC = new long[] {1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16};

    Tensor inputNHWDC = Tensor.fromBlob(dataNHWDC, shape, MemoryFormat.CHANNELS_LAST_3D);
    final Module module = loadModel(TEST_MODULE_ASSET_NAME);
    final IValue outputNCHWD = module.runMethod("contiguous", IValue.from(inputNHWDC));
    assertIValueTensor(outputNCHWD, MemoryFormat.CONTIGUOUS, shape, dataNCHWD);

    Tensor inputNCHWD = Tensor.fromBlob(dataNCHWD, shape, MemoryFormat.CONTIGUOUS);
    final IValue outputNHWDC =
        module.runMethod("contiguousChannelsLast3d", IValue.from(inputNCHWD));
    assertIValueTensor(outputNHWDC, MemoryFormat.CHANNELS_LAST_3D, shape, dataNHWDC);
  }

Domain

Subdomains

Frequently Asked Questions

What does testChannelsLast3d() do?
testChannelsLast3d() is a function in the pytorch codebase.
What does testChannelsLast3d() call?
testChannelsLast3d() calls 2 function(s): assertIValueTensor, loadModel.

Analyze Your Own Codebase

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

Try Supermodel Free