vfdff opened a new issue, #17556:
URL: https://github.com/apache/tvm/issues/17556

   I come across the error **AttributeError: module 'pytest' has no attribute 
'mark'** base on the demo test on https://www.cnblogs.com/whiteBear/p/18149428
   ```
   import tvm
   from tvm import te
   import tvm.relay as relay
   import numpy as np
   from tvm.relay.testing import run_opt_pass
   
   def get_relay_ir():
     shape = (1, 3, 14, 14)
     c_data = np.ones(shape).astype('float32')
     c = relay.const(c_data)
   
     weight = relay.var('weight', shape=(3, 3, 3, 3))
     x = relay.var('x', relay.TensorType((1, 3, 16, 16), 'float32'))
     conv = relay.nn.conv2d(x, weight)
     y = relay.add(conv, c)
     act = relay.nn.relu(y)
   
     mul = relay.multiply(conv, relay.const(0.5, 'float32'))
     z = act + mul
     return relay.Function([x, weight], z)
   
   
   f = get_relay_ir()
   mod = tvm.IRModule.from_expr(f)
   print('src module:')
   print(mod)
   
   mod = run_opt_pass(f, relay.transform.FuseOps(fuse_opt_level=4))
   print('fuse_ops:')
   print(mod)
   ```
   
   ### Expected behavior
   
   ```
   def @main(%x: Tensor[(1, 3, 16, 16), float32], %weight: Tensor[(3, 3, 3, 3), 
float32]) {
     %0 = nn.conv2d(%x, %weight, padding=[0, 0, 0, 0]);
     %1 = add(%0, meta[relay.Constant][0]);
     %2 = nn.relu(%1);
     %3 = multiply(%0, 0.5f);
     add(%2, %3)
   }
   
   
   fuse_ops:
   fn (%x: Tensor[(1, 3, 16, 16), float32], %weight: Tensor[(3, 3, 3, 3), 
float32]) -> Tensor[(1, 3, 14, 14), float32] {
     %4 = fn (%p0: Tensor[(1, 3, 16, 16), float32], %p1: Tensor[(3, 3, 3, 3), 
float32], %p2: Tensor[(1, 3, 14, 14), float32], Primitive=1) -> Tensor[(1, 3, 
14, 14), float32] {
       %0 = nn.conv2d(%p0, %p1, padding=[0, 0, 0, 0]);
       %1 = add(%0, %p2);
       %2 = nn.relu(%1);
       %3 = multiply(%0, 0.5f);
       add(%2, %3) 
     } 
     %4(%x, %weight, meta[relay.Constant][0])
   }
   ```
   
   ### Actual behavior
   
   ```
   (venv) [root@huawei-pc source]# python fuseOp.py 
   Traceback (most recent call last):
     File "/home/zhongyunde/source/fuseOp.py", line 6, in <module>
       from tvm.relay.testing import run_opt_pass
     File 
"/home/zhongyunde/source/venv/lib/python3.10/site-packages/tvm/relay/testing/__init__.py",
 line 28, in <module>
       from tvm.testing import enabled_targets
     File 
"/home/zhongyunde/source/venv/lib/python3.10/site-packages/tvm/testing/__init__.py",
 line 21, in <module>
       from .utils import *
     File 
"/home/zhongyunde/source/venv/lib/python3.10/site-packages/tvm/testing/utils.py",
 line 103, in <module>
       skip_if_wheel_test = pytest.mark.skipif(
   AttributeError: module 'pytest' has no attribute 'mark'
   ```
   
   ### Environment
   
   Operating System: Linux
   TVM version:  '0.12.0' (tvm.__version__)
      install with pip install pip install apache-tvm
   
   ### Steps to reproduce
   
   (venv) [root@huawei-pc source]# python fuseOp.py 
   
   ### Triage
   
   Please refer to the list of label tags 
[here](https://github.com/apache/tvm/wiki/Issue-Triage-Labels) to find the 
relevant tags and add them below in a bullet format (example below).
   
   * needs-triage
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to