File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -109,28 +109,29 @@ def wrapper(*args, **kwargs):
109
109
110
110
111
111
def load_chunk_file (filename ):
112
- np_array = np .asarray ( np . load (filename , mmap_mode = 'r' ) )
112
+ np_array = np .load (filename )
113
113
return np_array
114
114
115
115
116
116
class NpyLoader :
117
117
def __init__ (self , filename ):
118
118
self .filename = filename
119
119
self .np_array = None
120
- self .mmap = None
120
+ # self.mmap = None
121
121
122
122
def __enter__ (self ):
123
123
self .np_array = load_chunk_file (self .filename )
124
124
125
- self .mmap = getattr (self .np_array , 'base' , None )
125
+ # self.mmap = getattr(self.np_array, 'base', None)
126
126
127
127
return self .np_array
128
128
129
129
def __exit__ (self , exc_type , exc_value , traceback ):
130
- if self .np_array is not None :
131
- del self .np_array
132
- if self .mmap is not None and hasattr (self .mmap , 'close' ):
133
- self .mmap .close ()
130
+ pass
131
+ # if self.np_array is not None:
132
+ # del self.np_array
133
+ # if self.mmap is not None and hasattr(self.mmap, 'close'):
134
+ # self.mmap.close()
134
135
135
136
136
137
You can’t perform that action at this time.
0 commit comments