Skip to content

Commit

Permalink
demo fixes for hatlib 0.0.11 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
lisaong committed Apr 20, 2022
1 parent e3165f0 commit 31b8ff7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ No installation is required. This will launch a Jupyter notebook with the quicks
import numpy as np

# load the package
hat_package = hat.load("hello_accera.hat")
_, functions = hat.load("hello_accera.hat")

# call one of the functions with test inputs
A_test = np.random.rand(512, 512).astype(np.float32)
B_test = np.random.rand(512, 512).astype(np.float32)
C_test = np.zeros((512, 512)).astype(np.float32)
C_numpy = np.maximum(C_test + A_test @ B_test, 0.0)

matmul_relu = hat_package["matmul_relu_fusion_transformed"]
matmul_relu = functions["matmul_relu_fusion_transformed"]
matmul_relu(A_test, B_test, C_test)

# check correctness
Expand Down
6 changes: 3 additions & 3 deletions docs/demos/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@
"import numpy as np\n",
"\n",
"# load the package\n",
"hat_package = hat.load(\"hello_accera.hat\")\n",
"_, functions = hat.load(\"hello_accera.hat\")\n",
"\n",
"# call one of the functions with test inputs\n",
"A_test = np.random.rand(512, 512).astype(np.float32)\n",
"B_test = np.random.rand(512, 512).astype(np.float32)\n",
"C_test = np.zeros((512, 512)).astype(np.float32)\n",
"C_numpy = np.maximum(C_test + A_test @ B_test, 0.0)\n",
"\n",
"matmul_relu = hat_package[\"matmul_relu_fusion_transformed\"]\n",
"matmul_relu = functions[\"matmul_relu_fusion_transformed\"]\n",
"matmul_relu(A_test, B_test, C_test)\n",
"\n",
"# check correctness\n",
Expand Down Expand Up @@ -183,7 +183,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 31b8ff7

Please sign in to comment.