testChannelsLastConv3d() — pytorch Function Reference
Architecture documentation for the testChannelsLastConv3d() function in PytorchTestBase.java from the pytorch codebase.
Entity Profile
Dependency Diagram
graph TD ea12291d_f0db_4280_2dd1_8660c2cd2df4["testChannelsLastConv3d()"] 9f728842_eeeb_dcbf_a87a_1decf4b380f8["loadModel()"] ea12291d_f0db_4280_2dd1_8660c2cd2df4 -->|calls| 9f728842_eeeb_dcbf_a87a_1decf4b380f8 85d31af6_c650_49cb_5d35_da29aa71d31c["assertIValueTensor()"] ea12291d_f0db_4280_2dd1_8660c2cd2df4 -->|calls| 85d31af6_c650_49cb_5d35_da29aa71d31c style ea12291d_f0db_4280_2dd1_8660c2cd2df4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
android/pytorch_android/src/androidTest/java/org/pytorch/PytorchTestBase.java lines 408–486
@Test
public void testChannelsLastConv3d() throws IOException {
long[] inputShape = new long[] {1, 3, 2, 2, 2};
long[] dataNCDHW = new long[] {
1111, 1112,
1121, 1122,
1211, 1212,
1221, 1222,
2111, 2112,
2121, 2122,
2211, 2212,
2221, 2222,
3111, 3112,
3121, 3122,
3211, 3212,
3221, 3222};
Tensor inputNCDHW = Tensor.fromBlob(dataNCDHW, inputShape, MemoryFormat.CONTIGUOUS);
long[] dataNDHWC = new long[] {
1111, 2111, 3111,
1112, 2112, 3112,
1121, 2121, 3121,
1122, 2122, 3122,
1211, 2211, 3211,
1212, 2212, 3212,
1221, 2221, 3221,
1222, 2222, 3222};
Tensor inputNDHWC = Tensor.fromBlob(dataNDHWC, inputShape, MemoryFormat.CHANNELS_LAST_3D);
long[] weightShape = new long[] {3, 3, 1, 1, 1};
long[] dataWeightOIDHW = new long[] {
2, 0, 0,
0, 1, 0,
0, 0, -1,
};
Tensor wNCDHW = Tensor.fromBlob(dataWeightOIDHW, weightShape, MemoryFormat.CONTIGUOUS);
long[] dataWeightODHWI = new long[] {
2, 0, 0,
0, 1, 0,
0, 0, -1,
};
Tensor wNDHWC = Tensor.fromBlob(dataWeightODHWI, weightShape, MemoryFormat.CHANNELS_LAST_3D);
final Module module = loadModel(TEST_MODULE_ASSET_NAME);
final IValue outputNCDHW =
module.runMethod("conv3d", IValue.from(inputNCDHW), IValue.from(wNCDHW), IValue.from(false));
assertIValueTensor(
outputNCDHW,
MemoryFormat.CONTIGUOUS,
new long[] {1, 3, 2, 2, 2},
new long[] {
2*1111, 2*1112, 2*1121, 2*1122,
2*1211, 2*1212, 2*1221, 2*1222,
2111, 2112, 2121, 2122,
2211, 2212, 2221, 2222,
-3111, -3112, -3121, -3122,
-3211, -3212, -3221, -3222});
final IValue outputNDHWC =
module.runMethod("conv3d", IValue.from(inputNDHWC), IValue.from(wNDHWC), IValue.from(true));
assertIValueTensor(
outputNDHWC,
MemoryFormat.CHANNELS_LAST_3D,
new long[] {1, 3, 2, 2, 2},
new long[] {
2*1111, 2111, -3111, 2*1112, 2112, -3112,
2*1121, 2121, -3121, 2*1122, 2122, -3122,
2*1211, 2211, -3211, 2*1212, 2212, -3212,
2*1221, 2221, -3221, 2*1222, 2222, -3222});
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testChannelsLastConv3d() do?
testChannelsLastConv3d() is a function in the pytorch codebase.
What does testChannelsLastConv3d() call?
testChannelsLastConv3d() 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