Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

[BUG] IndexError was raised when deserialize a user-defined operand #1

Open
aresnow1 opened this issue Jul 28, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@aresnow1
Copy link

Describe the bug
IndexError was raised when deserialize a user-defined operand.

To Reproduce

from io import BytesIO

import mars.tensor as mt
from mars.tensor.operands import TensorOperand, TensorOperandMixin
from mars.serialization import AioSerializer, AioDeserializer
from mars.lib.aio import AioFileObject
from mars.core.entity.utils import tile


class TensorAddOne(TensorOperand, TensorOperandMixin):
    pass


async def serial():
    t = mt.random.rand(10, 10, chunk_size=7)
    c = tile(t).chunks[0]
    add_chunk = TensorAddOne(dtype=t.dtype).new_chunk([c], dtype=c.dtype, shape=c.shape, index=c.index)
    buffers = await AioSerializer(add_chunk).run()
    b = BytesIO()
    for buf in buffers:
        b.write(buf)
    b.seek(0)

    await AioDeserializer(AioFileObject(b)).run()


if __name__ == '__main__':
    import asyncio
    asyncio.run(serial())
@aresnow1 aresnow1 added the bug Something isn't working label Jul 28, 2022
@aresnow1 aresnow1 self-assigned this Aug 18, 2022
@qianduoduo0904
Copy link

This issue seems stay for a while, any plan to fix it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants