Skip to content

[IR] LazyTensor #2231

Closed
Closed
@justinchuby

Description

@justinchuby

LazyTensor(Callable[[], ir.TensorProtocol], dtype, shape, name)

This can save more memories and disk space for temporary files.

Create a LazyTensor class that implements the ir.TensorProtocol protol in onnxscript/ir/_core.py. It should take a function which returns a ir.TensorProtocol, a dtype and a shape argument. The idea is that the function will be lazily evaluated to get the actual ir.TensorProcol tensor when tobytes() or numpy() is called.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmodule: IRIntermediate representation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions