Depending on your nationality, if you don't need entry visa then you might be allowed based on the following. But if you need entry visa or already have TRV and your aim is to study, they will of course verify this at the point of entry - LETTER O ENROLMENT/ACCEPTANCE SHOWING ALL THE DATES. So if your program has ended then your study automatically becomes invalid after leaving Canada.
If you still need to attend your graduation ceremony (without plans to continue schooling), then you may enter with entry visa or without TRV if you're a visa -exempted national.