mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
@ -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 << "'.";
|
||||
|
Reference in New Issue
Block a user