MCPcopy Create free account
hub / github.com/pytorch/pytorch / testConcatNHWC

Method testConcatNHWC

caffe2/python/gradient_check_test.py:113–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

111 ]
112
113 def testConcatNHWC(self):
114 for input_size, d1, d2, d3, d4 in self.test_configs:
115 op = core.CreateOperator("Concat",
116 ["X1", "X2", "X3", "X4"],
117 ["Y", "Y_dims"],
118 order="NHWC"
119 )
120 Xs = [
121 np.random.rand(2, input_size, input_size,
122 d1).astype(np.float32),
123 np.random.rand(2, input_size, input_size,
124 d2).astype(np.float32),
125 np.random.rand(2, input_size, input_size,
126 d3).astype(np.float32),
127 np.random.rand(2, input_size, input_size, d4).astype(np.float32)
128 ]
129 for i in range(4):
130 res = device_checker.CheckSimple(op, Xs, [0])
131 self.assertTrue(res)
132 for checker in gradient_checkers:
133 res, grad, grad_estimated = checker.CheckSimple(op, Xs, i,
134 [0])
135 self.assertTrue(res)
136
137 def testConcatNCHW(self):
138 for input_size, d1, d2, d3, d4 in self.test_configs:

Callers

nothing calls this directly

Calls 4

astypeMethod · 0.80
rangeFunction · 0.50
randMethod · 0.45
CheckSimpleMethod · 0.45

Tested by

no test coverage detected