MCPcopy Create free account
hub / github.com/apache/singa / _concatenate_helper

Method _concatenate_helper

test/python/test_tensor.py:353–363  ·  view source on GitHub ↗
(self, dev)

Source from the content-addressed store, hash-verified

351 np.reshape(a.transpose(TRANSPOSE_AXES), RESHAPE_DIMS))
352
353 def _concatenate_helper(self, dev):
354 np1 = np.random.random([5, 6, 7, 8]).astype(np.float32)
355 np2 = np.random.random([5, 6, 7, 1]).astype(np.float32)
356 np3 = np.concatenate((np1, np2), axis=3)
357
358 t1 = tensor.Tensor(device=dev, data=np1)
359 t2 = tensor.Tensor(device=dev, data=np2)
360
361 t3 = tensor.concatenate((t1, t2), 3)
362
363 np.testing.assert_array_almost_equal(tensor.to_numpy(t3), np3)
364
365 def test_concatenate_cpu(self):
366 self._concatenate_helper(cpu_dev)

Callers 2

test_concatenate_cpuMethod · 0.95
test_concatenate_gpuMethod · 0.95

Calls 1

TensorMethod · 0.80

Tested by

no test coverage detected