-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2cb6ac
commit 2596ac1
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is a new file | ||
|
||
import torch | ||
|
||
def matrix_multiply(matrix_a, matrix_b): | ||
""" | ||
Multiplies two matrices using PyTorch. | ||
Args: | ||
- matrix_a (list of list of floats): The first matrix. | ||
- matrix_b (list of list of floats): The second matrix. | ||
Returns: | ||
- result (torch.Tensor): The result of the matrix multiplication. | ||
""" | ||
tensor_a = torch.tensor(matrix_a) | ||
tensor_b = torch.tensor(matrix_b) | ||
result = torch.matmul(tensor_a, tensor_b) | ||
return result |