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
import numpy as np | |
import torch | |
def sparse_retain(sparse_matrix, to_retain): | |
# if sparse_matrix.shape[0] != to_retain.shape[0]: | |
if len(sparse_matrix.coalesce().values()) != to_retain.shape[0]: | |
raise ValueError("Shape Not Matched!") | |
a_mat = torch.IntTensor([]) | |
np_indices = np.empty((1, 2), int) # dtype = np.int32) |
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
Computer Information: | |
Manufacturer: Unknown | |
Model: Unknown | |
Form Factor: Laptop | |
No Touch Input Detected | |
Processor Information: | |
CPU Vendor: GenuineIntel | |
CPU Brand: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz | |
CPU Family: 0x6 |