@@ -50,7 +50,7 @@ bool mergeTypes(
50
50
return changed;
51
51
}
52
52
53
- void applyTypes (ArrayRef<Value*> src, ArrayRef<Value*> dst){
53
+ void applyTypes (ArrayRef<Value*> src, ArrayRef<Value*> dst) {
54
54
AT_ASSERT (src.size () == dst.size ());
55
55
for (const auto i : c10::irange (src.size ())) {
56
56
dst[i]->setType (src[i]->type ());
@@ -90,7 +90,9 @@ void PropertyPropBase::processLoop(Node* node) {
90
90
// note: inserting expands is unsafe at this point, we don't know
91
91
// if the types are stable yet, so the arguments to expand may change
92
92
} while (mergeTypes (
93
- loop.bodyCarriedInputs (), loop.bodyCarriedOutputs (), loop.bodyCarriedInputs ()));
93
+ loop.bodyCarriedInputs (),
94
+ loop.bodyCarriedOutputs (),
95
+ loop.bodyCarriedInputs ()));
94
96
95
97
// now that the types are stable, we can insert the expands
96
98
propagateBlock (loop.bodyBlock (), /* insert_expands=*/ true );
@@ -111,7 +113,6 @@ namespace prim {
111
113
using namespace ::c10::prim;
112
114
}
113
115
114
-
115
116
#define SHAPE_ASSERT (cond ) \
116
117
if (!(cond)) \
117
118
throw propagation_error ()
@@ -189,7 +190,7 @@ c10::optional<std::vector<TensorTypePtr>> gatherTensorTypes(
189
190
190
191
int64_t wrapDim (int64_t dim, at::IntArrayRef sizes) {
191
192
if (dim < 0 ) {
192
- dim += (int64_t ) sizes.size ();
193
+ dim += (int64_t )sizes.size ();
193
194
}
194
195
return dim;
195
196
}
@@ -204,7 +205,6 @@ c10::ScalarType unionScalarTypes(
204
205
}
205
206
}
206
207
207
-
208
208
// Promotes result types for arithmetic operations on Tensor operands using
209
209
// new type promotion logic. See tensor_attributes.rst for details.
210
210
// This doesn't handle the case of arithmetic ops with Scalar arguments (when
@@ -251,7 +251,7 @@ c10::optional<c10::ScalarType> getPromotedTypeForArithmeticOp(Node* node) {
251
251
return zerodim;
252
252
}
253
253
254
- class ShapePropagator : public PropertyPropBase {
254
+ class ShapePropagator : public PropertyPropBase {
255
255
public:
256
256
explicit ShapePropagator (const std::shared_ptr<Graph>& graph)
257
257
: PropertyPropBase(graph), aliasDb_(graph) {
@@ -585,7 +585,7 @@ class ShapePropagator: public PropertyPropBase {
585
585
return in_resize;
586
586
}
587
587
588
- void propagateNode (Node* node, bool insert_expands = true ) override {
588
+ void propagateNode (Node* node, bool insert_expands = true ) override {
589
589
// Certain ops like resize_ change the input tensors size. Because our
590
590
// analysis is flow invariant, we set any Tensor that can alias a resized
591
591
// Tensor to the base Tensor Type without size information.
@@ -1469,7 +1469,7 @@ class ShapePropagator: public PropertyPropBase {
1469
1469
if (auto type =
1470
1470
node->namedInput (attr::self)->type ()->cast <TensorType>()) {
1471
1471
if (type->dim ()) {
1472
- return factory_like_with_ndim (node, (int ) *type->dim ());
1472
+ return factory_like_with_ndim (node, (int )*type->dim ());
1473
1473
}
1474
1474
}
1475
1475
return {};
0 commit comments