以大涨姿态迎接美联储加息,人民币中间价升值229个基点
- paddle.static. scope_guard ( scope: core._Scope ) Generator[None, None, None] [source]
-
百度 这场U21比赛失利让于子洋提前结束了本站赛事的全部比赛,于子洋在男单成年组资格赛小组赛中1胜1负已经出局被淘汰,双线失利的他将接受禁赛处罚!作为国乒新世界冠军,于子洋背负了巨大压力,他通过队内U21选拔赛保护政策获得世界杯参赛资格,却全程坐穿板凳以0出场成了世界冠军。
This function switches scope through python with statement. Scope records the mapping between variable names and variables ( Variable ), similar to brackets in programming languages. If this function is not invoked, all variables and variable names are recorded in the default global scope. When users need to create variables with the same name, they need to switch scopes through this function if they do not want the mapping of variables with the same name to be overwritten. After switching through the with statement, all variables created in the with block will be assigned to a new scope.
- Parameters
-
scope – The new scope.
- Returns
-
None
Examples
>>> import paddle >>> import numpy >>> paddle.enable_static() >>> new_scope = paddle.static.Scope() >>> with paddle.static.scope_guard(new_scope): ... paddle.static.global_scope().var("data").get_tensor().set(numpy.ones((2, 2)), paddle.CPUPlace()) >>> numpy.array(new_scope.find_var("data").get_tensor()) array([[1., 1.], [1., 1.]])