主权项 |
1. A method performed by an electronic device, the method comprising:
identifying, by the electronic device, a fixed-point operation in a first representation,
the fixed-point operation utilizing a first operand and a second operand,the first operand having a first data type comprising a first slope value and a first bias value,the second operand having a second data type comprising a second slope value and a second bias value, andthe first slope value being different from the second slope value or the first bias value being different from the second bias value; determining, by the electronic device, a fixed-point typing rule based on the first data type of the first operand and the second data type of the second operand; associating, by the electronic device, the fixed-point typing rule as an attribute of a portion of a graphical model; determining, by the electronic device and at compile time, that the first data type of the first operand and the second data type of the second operand are known; determining, by the electronic device, a result data type of an output of the fixed-point operation based on the fixed-point typing rule, the first data type of the first operand, and the second data type of the second operand; generating, by the electronic device and for the graphical model, a second representation of the fixed-point operation based on determining the result data type; evaluating, by the electronic device and during execution, the fixed-point operation based on the second representation; and generating, by the electronic device and based on evaluating the second representation, the output of the fixed-point operation having the result data type. |