relay/frontend/pytorch.py
def _view():
def _impl(inputs, input_types):
data = inputs[0]
if len(inputs) == 3:
new_shape = [inputs[1], _infer_shape(inputs[2])[0]]
else:
if isinstance(inputs[1], list):
new_shape = inputs[1]
if isinstance(inputs[1][1], _expr.Expr):
shape = _infer_shape(inputs[1][1])
print(shape,’>>>>>>>>>>>>>>>’)
temp = inputs[1][1]
print(dir(temp),type(temp))
print(type(new_shape), new_shape)
else:
new_shape = _infer_shape(inputs[1])
print(type(new_shape), new_shape)
print(type(new_shape), new_shape)
return _op.transform.reshape(data, new_shape)
return _impl
output::
() >>>>>>>>>>>>>>>
[‘checked_type’, ‘args’, ‘attrs’, ‘op’, ‘span’, ‘type_args’] <class
‘tvm.relay.expr.Call’>
<class ‘list’> [1, CallNode(Op(multiply), [Constant(8), Constant(512)], (nullptr), []), 4, 4]