# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ import mindspore as ms from mindspore.ops import Primitive from mindspore.ops import operations as P get_next = P.GetNext([ms.float32], [[1, 64, 112, 112]], 1, "") tensor_move_attr = Primitive('TensorMove') tensor_move_attr.add_prim_attr("label_for_insert_stream_active", True) tensor_move = Primitive('tensor_move') cast = P.Cast() add = P.Add() class FnDict: def __init__(self): self.fnDict = {} def __call__(self, fn): self.fnDict[fn.__name__] = fn def __getitem__(self, name): return self.fnDict[name]
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ import mindspore as ms from mindspore.ops import Primitive from mindspore.ops import operations as P get_next = P.GetNext([ms.float32], [[1, 64, 112, 112]], 1, "") memcpy_async_attr = Primitive('memcpy_async') memcpy_async_attr.add_prim_attr("label_for_insert_stream_active", True) memcpy_async = Primitive('memcpy_async') cast = P.Cast() add = P.TensorAdd() class FnDict: def __init__(self): self.fnDict = {} def __call__(self, fn): self.fnDict[fn.__name__] = fn def __getitem__(self, name): return self.fnDict[name]