@pytest.mark.hasgpu
def test_copy_transpose(shape_inp, backend_pair_dtype):
 (shape, (name, inp_gen)) = shape_inp
 (ng, nc) = backend_pair_dtype
 np_inp = inp_gen(shape).astype(nc.default_dtype)
 ndims = len(shape)
 axes = ([None] + list(itt.permutations(range(ndims), ndims)))
 axes.remove(tuple(range(ndims)))
 for (be, ax) in itt.product([ng, nc], axes):
  be_inp = be.array(np_inp)
  np_trans = np.transpose(np_inp, axes=ax)
  be_trans = be.zeros(np_trans.shape)
  be.copy_transpose(be_inp, be_trans, axes=ax)
  assert tensors_allclose(np_trans, be_trans)

@ pytest . mark . hasgpu def test_copy_transpose ( shape_inp , backend_pair_dtype ) : ( shape , ( name , inp_gen ) ) = shape_inp ( ng , nc ) = backend_pair_dtype np_inp = inp_gen ( shape ) . astype ( nc . default_dtype ) ndims = len ( shape ) axes = ( [ None ] + list ( itt . permutations ( range ( ndims ) , ndims ) ) ) axes . remove ( tuple ( range ( ndims ) ) ) for ( be , ax ) in itt . product ( [ ng , nc ] , axes ) : be_inp = be . array ( np_inp ) np_trans = np . transpose ( np_inp , axes = ax ) be_trans = be . zeros ( np_trans . shape ) be . copy_transpose ( be_inp , be_trans , axes = ax ) assert tensors_allclose ( np_trans , be_trans )
parameterized test case .