Skip to content

Tensor.shape Node (Dynamic Handle Generation) #11

@ManjotSingh08x

Description

@ManjotSingh08x

Description

Introduce a new node type similar to PyTorch's Tensor.shape that outputs integer handles based on input tensor dimensions

Tasks

  • Implement Tensor.shape node.
  • Upon receiving input shape, dynamically generate N handles (one per dimension)
  • Each handle outputs an integer dimension usable by other nodes as a parameter. (e.g., for linear layers, reshaping, parameter specs)
  • Create another edge type which is specifically designed to handle integer information. This edge type carries actual value of integer and the name of the variable. This edge can be used to parameterize other layers
    Example:
 B, C, H, W = x.shape
y = x.reshape(B, C, -1)
z = x.reshape(B, -1, H * W)

Such kind of basic arithmetic and parameterization should be possible graphically.

  • Update shape computation, shape verification and generation pipelines to support this functionality.
  • Allow direct use of variable names inside parameter slots if the corresponding integer edge is connected. Add verification and translation into actual value inside node data on the front end

Expected Outcomes

  • Tensor.shape node dynamically re-renders handles when input dimensions change.
  • Downstream modules can use these integer outputs as variable parameters
  • Shape propagation and code generation works reliably through this node.

Metadata

Metadata

Assignees

Labels

featurenew improvement or additionhigh priorityIssues which need to be completed as soon as possibleoverhaulbig changes to core systems

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions