Revert "Add support for torch.Generator type in TorchScript (#110413)"

This reverts commit 54493fe8c4b1cca4c5ff993b99eb3e3dbc984226.

Reverted https://github.com/pytorch/pytorch/pull/110413 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it is, unfortunately, still breaking internal builds ([comment](https://github.com/pytorch/pytorch/pull/110413#issuecomment-1811625557))
This commit is contained in:
PyTorch MergeBot
2023-11-15 00:51:23 +00:00
parent c892f1a318
commit 252e68a83b
39 changed files with 178 additions and 655 deletions

View File

@ -241,17 +241,6 @@ std::shared_ptr<SugaredValue> SimpleValue::attr(
return SpecialFormValue::create(aten::index);
}
if (auto generator_type = value_->type()->cast<GeneratorType>()) {
// Handle access to Generator's `manual_seed`, `initial_seed` and `seed`
// attributes.
if (field == "manual_seed" || field == "initial_seed" || field == "seed") {
if (auto builtin = BuiltinFunction::tryCreate(
Symbol::aten(field), NamedValue(loc, "self", value_))) {
return builtin;
}
}
}
ErrorReport report(loc);
report << "'" << value_->type()->repr_str()
<< "' object has no attribute or method '" << field << "'.";