回答編集履歴

1

追記

2021/11/01 08:34

投稿

8524ba23
8524ba23

スコア38341

test CHANGED
@@ -9,3 +9,65 @@
9
9
  Lx = laplacian(verts, faces) # VとFを渡す
10
10
 
11
11
  ```
12
+
13
+ 概念再現例
14
+
15
+ ```Python
16
+
17
+ class Module(object):
18
+
19
+
20
+
21
+ def __init__(self):
22
+
23
+ pass
24
+
25
+
26
+
27
+ def __call__(self, *input,**kwargs):
28
+
29
+ return self.forward(*input, **kwargs)
30
+
31
+
32
+
33
+ def forward(self, *input, **kwargs):
34
+
35
+ pass
36
+
37
+
38
+
39
+ class Laplacian(Module):
40
+
41
+
42
+
43
+ def __init__(self, cot=True):
44
+
45
+ super(Laplacian, self).__init__()
46
+
47
+ self.cot = cot
48
+
49
+
50
+
51
+ def forward(self, V, F):
52
+
53
+ print(f'{V},{F}')
54
+
55
+ return 'forward_ret'
56
+
57
+
58
+
59
+
60
+
61
+ verts, faces = 'verts', 'faces'
62
+
63
+
64
+
65
+ laplacian = Laplacian()
66
+
67
+ #ret = laplacian(verts) # TypeError: forward() missing 1 required positional argument: 'F'
68
+
69
+ ret = laplacian(verts, faces) # verts,faces
70
+
71
+ print(ret) # forward_ret
72
+
73
+ ```