|
1 | 1 | import numpy as np
|
2 | 2 |
|
3 | 3 | import pytensor.tensor as pt
|
4 |
| -from pytensor.compile.ops import DeepCopyOp, ViewOp |
5 | 4 | from pytensor.configdefaults import config
|
6 | 5 | from pytensor.graph.fg import FunctionGraph
|
7 | 6 | from pytensor.tensor.shape import Shape, Shape_i, Unbroadcast, reshape
|
@@ -46,27 +45,17 @@ def test_pytorch_Reshape_constant():
|
46 | 45 | compare_pytorch_and_py(x_fg, [np.r_[1.0, 2.0, 3.0, 4.0].astype(config.floatX)])
|
47 | 46 |
|
48 | 47 |
|
49 |
| -def test_pytorch_Reshape_shape_graph_input(): |
| 48 | +def test_pytorch_Reshape_dynamic(): |
50 | 49 | a = vector("a")
|
51 | 50 | shape_pt = iscalar("b")
|
52 | 51 | x = reshape(a, (shape_pt, shape_pt))
|
53 | 52 | x_fg = FunctionGraph([a, shape_pt], [x])
|
54 | 53 | compare_pytorch_and_py(x_fg, [np.r_[1.0, 2.0, 3.0, 4.0].astype(config.floatX), 2])
|
55 | 54 |
|
56 | 55 |
|
57 |
| -def test_pytorch_compile_ops(): |
58 |
| - x = DeepCopyOp()(pt.as_tensor_variable(1.1)) |
59 |
| - x_fg = FunctionGraph([], [x]) |
60 |
| - |
61 |
| - compare_pytorch_and_py(x_fg, []) |
62 |
| - |
| 56 | +def test_pytorch_unbroadcast(): |
63 | 57 | x_np = np.zeros((20, 1, 1))
|
64 | 58 | x = Unbroadcast(0, 2)(pt.as_tensor_variable(x_np))
|
65 | 59 | x_fg = FunctionGraph([], [x])
|
66 | 60 |
|
67 | 61 | compare_pytorch_and_py(x_fg, [])
|
68 |
| - |
69 |
| - x = ViewOp()(pt.as_tensor_variable(x_np)) |
70 |
| - x_fg = FunctionGraph([], [x]) |
71 |
| - |
72 |
| - compare_pytorch_and_py(x_fg, []) |
0 commit comments