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.
It is a bit annoying that a setters isn't prefixed with set: in general I rather have method starting with a verb expressing their actions. (This is also the general style in MLIR I believe).
That said we already emit the getters without a get similarly, so this is in line with what is already there.