Пример #1
0
 def __hash__(self):
     error_msg = "Arguments to a `@paddle.jit.to_static` must be a hashable Python objects (or nested structures of these types)."
     with_hook = self.kwargs.get("with_hook", False)
     is_train = self.kwargs.get("is_train", False)
     return hash((id(self.function_spec),
                  make_hashable(self.input_args_with_spec, error_msg),
                  make_hashable(self.input_kwargs_with_spec,
                                error_msg), self._spec_names_id,
                  self.class_instance, with_hook, is_train))
Пример #2
0
 def __hash__(self):
     error_msg = "Arguments to a `@paddle.jit.to_static` must be a hashable Python objects (or nested structures of these types)."
     return hash((id(self.function_spec),
                  make_hashable(self.input_with_spec, error_msg),
                  self.class_instance))