|
| 1 | +# |
| 2 | +#Copyright 2024 Massimo Fioravanti |
| 3 | +# |
| 4 | +#Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +#you may not use this file except in compliance with the License. |
| 6 | +#You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +#Unless required by applicable law or agreed to in writing, software |
| 11 | +#distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +#See the License for the specific language governing permissions and |
| 14 | +#limitations under the License. |
| 15 | +# |
| 16 | +import action |
| 17 | +import collections.vector |
| 18 | +import string |
| 19 | + |
| 20 | +ent<T> Hidden: |
| 21 | + T value |
| 22 | + |
| 23 | + fun assign(T content): |
| 24 | + self.value = content |
| 25 | + |
| 26 | +fun<T> write_in_observation_tensor(Hidden<T> obj, Vector<Float> output, Int index): |
| 27 | + return |
| 28 | + |
| 29 | +fun<T> size_as_observation_tensor(Hidden<T> obj) -> Int: |
| 30 | + return 0 |
| 31 | + |
| 32 | +fun<T> append_to_vector(Hidden<T> to_add, Vector<Byte> output): |
| 33 | + append_to_byte_vector(to_add.value, output) |
| 34 | + |
| 35 | +fun<T> parse_from_vector(Hidden<T> to_add, Vector<Byte> output, Int index) -> Bool: |
| 36 | + return from_byte_vector(to_add.value, output, index) |
| 37 | + |
| 38 | +fun<T> append_to_string(Hidden<T> to_add, String output): |
| 39 | + to_string(to_add.value, output) |
| 40 | + |
| 41 | +fun<T> parse_string(Hidden<T> to_add, String input, Int index) -> Bool: |
| 42 | + return from_string(to_add.value, input, index) |
| 43 | + |
0 commit comments