Skip to content

Commit

Permalink
Fix LINT errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abhikran-quic committed Jul 15, 2023
1 parent 2b25d13 commit b881efa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/tvm/relax/attrs/manipulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ struct LayoutTransformAttrs : public tvm::AttrsNode<LayoutTransformAttrs> {
* non-flat memory, each entry in axis_separators should be the
* first input axis that is part of a new flattened axis.
*/
Optional<Array<IntImm>> axis_separators;
Optional<Array<IntImm>> axis_separators;

TVM_DECLARE_ATTRS(LayoutTransformAttrs, "relax.attrs.LayoutTransformAttrs") {
TVM_ATTR_FIELD(index_map).describe("The layout transformation to apply.");
TVM_ATTR_FIELD(pad_value).describe(
"The specific value to be used to pad if the layout transform would result in implicit "
"padding. If not specified, the compiler is free to choose any value.");
TVM_ATTR_FIELD(axis_separators).describe(
"The separators between input axes when generating flat output axes");
TVM_ATTR_FIELD(axis_separators).
describe("The separators between input axes when generating flat output axes");
}
}; // struct LayoutTransformAttrs

Expand Down
2 changes: 1 addition & 1 deletion src/relax/op/tensor/manipulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Expr flatten(Expr x);
* \param pad_value The value used for padding if the transformation results in implicit padding. If
* not specified, any value can be used.
* \param axis_separators Array of values to differentiate between input axes
* when generating flattened output axes
* when generating flattened output axes.
* \return The transformed result.
*/
Expr layout_transform(Expr x, tir::IndexMap index_map, Optional<PrimValue> pad_value,
Expand Down
7 changes: 4 additions & 3 deletions src/relax/transform/alter_op_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class AlterOpImplMutator : public ExprMutator {
Array<IndexMap> buffer_transforms;
Optional<Array<Array<IntImm>>> axis_separators;
if (op_buffer_transforms__.count(op_kind)) buffer_transforms = op_buffer_transforms__[op_kind];
if (op_buffer_axis_separators__.count(op_kind)) axis_separators = op_buffer_axis_separators__[op_kind];
if (op_buffer_axis_separators__.count(op_kind))
axis_separators = op_buffer_axis_separators__[op_kind];

ICHECK(buffer_transforms.empty() || buffer_transforms.size() == replacement_func->params.size())
<< "Either the i/o buffers do not require any transformations or transformations for each "
Expand Down Expand Up @@ -210,7 +211,7 @@ class AlterOpImplMutator : public ExprMutator {
* \brief Updates call inputs with layout transformed inputs
*/
Tuple UpdateInputs(const Tuple& inputs, const Array<IndexMap>& transforms,
Optional<Array<Array<IntImm>>>& axis_separators) {
const Optional<Array<Array<IntImm>>>& axis_separators) {
if (transforms.empty()) return inputs;

Array<Expr> updated_inputs;
Expand Down Expand Up @@ -268,7 +269,7 @@ class AlterOpImplMutator : public ExprMutator {

Expr TransformOutputs(const Expr& expr, const Array<IndexMap>& buffer_transforms,
const StructInfo& old_struct_info,
Optional<Array<Array<IntImm>>>& axis_separators) {
const Optional<Array<Array<IntImm>>>& axis_separators) {
if (buffer_transforms.empty()) return expr;

Array<TensorStructInfo> old_output_sinfo = GetTensorStructInfoPerOutput(old_struct_info);
Expand Down

0 comments on commit b881efa

Please sign in to comment.