-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Switch c10::optional<ShapeSymbol> with just ShapeSymbol. #38411
Copy link
Copy link
Closed
Labels
module: bootcampWe plan to do a full writeup on the issue, and then get someone to do it for onboardingWe plan to do a full writeup on the issue, and then get someone to do it for onboardingoncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Metadata
Metadata
Assignees
Labels
module: bootcampWe plan to do a full writeup on the issue, and then get someone to do it for onboardingWe plan to do a full writeup on the issue, and then get someone to do it for onboardingoncall: jitAdd this issue/PR to JIT oncall triage queueAdd this issue/PR to JIT oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
🚀 Feature
symbolic_sizes_property of TensorType API.TensorTypeis a class to represent a tensor type in TorchScript IR.TensorTypetracks various properties of a tensor such as tensor shape, strides, device, requires_grad, etc. TorchScript IR consists mostly ofNodeandValue.Nodes denote operations that produce outputs (Values) . Each value is statically typed withTypeand that type can beTensorType.c10::optional<int64_t>sShapeSymbolclass to representsizeand values and it has its own way of expressing unknown values`-1) which we can use to denote unknown symbols (https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/core/jit_type.h#L389)Motivation
Pitch
unknownSymbolto denote unknown/varying shapeunknownSymbolin lieu ofc10::optional<ShapeSymbol>VaryingShape<ShapeSymbol>with justc10::optional<std::vector<ShapeSymbol>>Alternatives
Do nothing n and suffer from the current design.
Additional context
For questions, ping @Krovatkin
cc @suo