Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit the use of constant(value, element_type) for quantized types #1687

Open
sdasgup3 opened this issue Jul 13, 2023 · 2 comments
Open

Audit the use of constant(value, element_type) for quantized types #1687

sdasgup3 opened this issue Jul 13, 2023 · 2 comments
Assignees
Labels

Comments

@sdasgup3
Copy link
Member

sdasgup3 commented Jul 13, 2023

In the spec, there are several places like this, where we use constant(some_constant_value, element_type(result)) to produce a constant of type element_type(result). However, this should not be confused with the StableHLO constant op which only produces constant with tensor types.

IMO, to avoid confusion, we should introduce a separate meta function, under the spec section "function on values", as follows.

* `constant(x: Value, type: TensorElementType | QuantizedTensorElementType)` is
defined on constant inputs and returns a constant of type `TensorElementType` or
`QuantizedTensorElementType`.
@burmako
Copy link
Contributor

burmako commented Jul 17, 2023

"However, this should not be confused with the StableHLO constant op which only produces constant with tensor types". I am a bit confused because #1647 (the discussion in which seems to have prompted creating this ticket) changes ConstantOp to support constants with quantized tensor type as well?

@burmako burmako changed the title Clarify the use of constant(value, element_type) in spec Audit the use of constant(value, element_type) for quantized types Jul 17, 2023
@sdasgup3
Copy link
Member Author

Per the analysis in here, the following ops ops has usages of constant meta-functions which are yet to be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants