In some dialects, attributes may have default values that may be determined only after shape inference. For example, attributes that are dependent on the rank of the input cannot be assigned a default value until the rank of the tensor is inferred.
While we can set attributes without explicit setters, referring to the attributes via accessors instead of having to use the string interface is better for compile time verification.
The proposed patch add one method per operation attribute that let us set its value. The code is a very small modification of the existing getter methods.
Reflow?
This comment may also be more relevant inside: e.g., there are potentially multiple setters, as with getters, and this is one specific to raw setters.