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
  aff8d52f_206b_e498_62ce_be4e195eaa12["testChannelsLast3d()"]
  fd3711c0_c2a1_0848_309d_ba2ef1be4466["loadModel()"]
  aff8d52f_206b_e498_62ce_be4e195eaa12 -->|calls| fd3711c0_c2a1_0848_309d_ba2ef1be4466
  076e553b_79aa_4059_bfb2_6682a21ae462["assertIValueTensor()"]
  aff8d52f_206b_e498_62ce_be4e195eaa12 -->|calls| 076e553b_79aa_4059_bfb2_6682a21ae462
  style aff8d52f_206b_e498_62ce_be4e195eaa12 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);
  }

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