You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both sampler1.run() and sampler2.run() will actually run in job mode, not session, even though session mode is more likely what they want, given .run() is invoked under the Session context manager. While this is technically a user error, it's not intuitive that specifying the backend keyword would negate the Session context (although it'd help when the backend parameter is dropped in favor of mode).
We should make it so that if run() is called inside a Session or Batch context, session/batch is used. Although this is a breaking change so we'd need to do some warning first.
Acceptance criteria
Issue a deprecation warning if a job inside a session/batch context will actually run in job mode. The warning message should say the job will run in job mode, and the behavior will change to session/batch mode in the near future.
After the deprecation period, make the job to actually run in session/batch mode if it's inside a session/batch context
If a backend is specified for both the primitive and session/batch, raises an error, e.g.
withSession(backend=bar):
sampler=SamplerV2(backend=foo)
sampler.run() # <-- this should raise an error since we don't know if `foo` or `bar` should be used as the backend
The text was updated successfully, but these errors were encountered:
What is the expected feature or enhancement?
Today if someone does
Both
sampler1.run()
andsampler2.run()
will actually run in job mode, not session, even though session mode is more likely what they want, given.run()
is invoked under theSession
context manager. While this is technically a user error, it's not intuitive that specifying thebackend
keyword would negate the Session context (although it'd help when thebackend
parameter is dropped in favor ofmode
).We should make it so that if
run()
is called inside aSession
orBatch
context, session/batch is used. Although this is a breaking change so we'd need to do some warning first.Acceptance criteria
The text was updated successfully, but these errors were encountered: