Fixed check for the buffer overflow in assert (#36476)
Summary:
This code looks like a mistake
```C++
AT_ASSERT(size_t(kind) < sizeof(names) / sizeof(AttributeKind));
```
It does not check if `kind` variable fits in array of pointer called `names`
Even if we write something like this: that assert won't fail
```C++
AttributeKind kind = AttributeKind::ival;
*((unsigned int*)&kind2) += 1;
```
So I fixed it
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36476
Differential Revision: D21018748
Pulled By: colesbury
fbshipit-source-id: f4d3b8faf64cf07232d595075f831805084f5d00