(expr)
| 11947 | throw new python.Error(`Unknown type name '${name}'.`); |
| 11948 | } |
| 11949 | parseBaseTypeName(expr) { |
| 11950 | if (expr instanceof ast.Name) { |
| 11951 | return expr.id; |
| 11952 | } else if (expr instanceof ast.Constant && expr.value === null) { |
| 11953 | return 'None'; |
| 11954 | } else if (expr instanceof ast.Attribute) { |
| 11955 | const name = expr.attr; |
| 11956 | const tensor_subtypes = new Set(['Tensor', 'LongTensor', 'FloatTensor', 'DoubleTensor', 'IntTensor', 'ShortTensor', 'HalfTensor', 'CharTensor', 'ByteTensor', 'BoolTensor']); |
| 11957 | if (torch._C.isTorch(expr.value) && tensor_subtypes.has(name)) { |
| 11958 | return name; |
| 11959 | } |
| 11960 | return torch._C.collectQualname(expr); |
| 11961 | } |
| 11962 | throw new python.Error(`Unsupported type '${expr.__class__.__name__}'.`); |
| 11963 | } |
| 11964 | parseBroadcastList(/* expr */) { |
| 11965 | return null; |
| 11966 | } |
no test coverage detected