Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created March 6, 2024 17:52
Show Gist options
  • Save quantra-go-algo/1afff5354512ba5fd9d0410c2d37dca2 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/1afff5354512ba5fd9d0410c2d37dca2 to your computer and use it in GitHub Desktop.
# Import the corresponding library
import cupy as cp
# Define matrices using CuPy arrays
matrix_a = cp.array([[1, 2], [3, 4]])
matrix_b = cp.array([[5, 6], [7, 8]])
# Perform a matrix multiplication using CuPy
result = cp.matmul(matrix_a, matrix_b)
print("Result of Matrix Multiplication:")
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment