Example #1
0
 def __init__(self, strategy1, strategy2):
     super().__init__()
     self.matmul = P.MatMul().set_strategy(strategy1)
     self.asin = P.Asin().set_strategy(strategy2)
     self.matmul2 = P.MatMul().set_strategy(strategy1)
Example #2
0
def test_asin_fp32():
    x_np = np.array([0.74, 0.04, 0.30, 0.56]).astype(np.float32)
    output_ms = P.Asin()(Tensor(x_np))
    output_np = np.arcsin(x_np)
    assert np.allclose(output_ms.asnumpy(), output_np)
Example #3
0
 def __init__(self):
     super(NetAsin, self).__init__()
     self.asin = P.Asin()