code: def test_pow(val_shape):
      # A ** v
      ctx = F.ctx()
      row = torch.tensor([1, 0, 2]).to(ctx)
      col = torch.tensor([0, 3, 2]).to(ctx)
      val = torch.randn(val_shape).to(ctx)
      A = from_coo(row, col, val, shape=(3, 4))
      exponent = 2
      A_new = A**exponent
      assert torch.allclose(A_new.val, val**exponent)
      assert A_new.shape == A.shape
      new_row, new_col = A_new.coo()
      assert torch.allclose(new_row, row)
      assert torch.allclose(new_col, col)
  
      # power(A, v)
      A_new = power(A, exponent)
      assert torch.allclose(A_new.val, val**exponent)
      assert A_new.shape == A.shape
      new_row, new_col = A_new.coo()
      assert torch.allclose(new_row, row)
      assert torch.allclose(new_col, col)
  
file_path: dgl/tests/python/pytorch/sparse/test_elementwise_op_sp.py
imports: import sys
  import backend
  import pytest
  import torch
  from dgl.sparse import div, from_coo, mul, power, spmatrix, val_like
  from .utils import rand_coo, rand_csc, rand_csr, rand_diag, sparse_matrix_to_dense
label_desc: Use image node_id 3 for calling a global function with example usage: test_pow(val_shape) without return types