Skip to content

Commit

Permalink
fix for test
Browse files Browse the repository at this point in the history
  • Loading branch information
Coco58323 committed Sep 6, 2021
1 parent ad14c62 commit b5769cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
4 changes: 2 additions & 2 deletions mars/deploy/oscar/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ async def destroy(self):
await self._session_api.delete_session(self._session_id)
if self._asyncio_task_timeout_detector_task: # pragma: no cover
self._asyncio_task_timeout_detector_task.cancel()

async def create_remote_object(self,
session_id: str,
name: str,
Expand Down Expand Up @@ -1123,7 +1123,7 @@ async def create_mutable_tensor(self,
chunksize,
name: str = None):
pass # pragma: no cover

@implements(AbstractAsyncSession.get_web_endpoint)
@_delegate_to_isolated_session
async def get_web_endpoint(self) -> Optional[str]:
Expand Down
19 changes: 4 additions & 15 deletions mars/services/mutable/supervisor/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .... import oscar as mo
from ..worker.service import MutableTensorChunkActor


class MutableTensorActor(mo.Actor):
def __init__(self, shape: tuple, dtype: str, chunksize, name: str = None):
self._shape = shape
Expand Down Expand Up @@ -61,7 +62,7 @@ async def write(self, index,value):

async def read(self, index):
result = split_indexes_into_chunks(self._nsplits,index)
ans=[]
ans_list = []
for idx,v in result[0].items():
if len(v[0] > 0):
target_index = 0
Expand All @@ -75,17 +76,5 @@ async def read(self, index):
for nidx in v:
val = await chunk_actor.read(idx,nidx)
print(idx,nidx,val)
ans.append(val)
return ans

@property
def shape(self):
return self._shape

@property
def dtype(self):
return self._dtype

@property
def name(self):
return self._name
ans_list.append(val)
return ans_list
4 changes: 3 additions & 1 deletion mars/services/session/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ async def fetch_tileable_op_logs(self,

@abstractmethod
async def create_mutable_tensor(self,
session_id: str,
shape: tuple,
dtype: str,
chunksize,
dtype: str):
name: str = None):
"""
Create a mutable tensor.
"""

0 comments on commit b5769cb

Please sign in to comment.