| 155 | } |
| 156 | |
| 157 | std::tuple<SmallVector<LogicalTensorDesc>, bool> infer_output_attrs_fallible( |
| 158 | const OpDef& def, const SmallVector<LogicalTensorDesc>& inputs) { |
| 159 | if (inputs.size() >= 2) { |
| 160 | return proxy_graph_detail::infer_output_attrs_fallible(def, inputs); |
| 161 | } |
| 162 | auto&& inp = inputs[0]; |
| 163 | auto& inp_cn = inp.comp_node; |
| 164 | if (inp.layout.ndim == 0) { |
| 165 | return {{{TensorLayout{inp.layout.dtype}, inp_cn, {}}}, false}; |
| 166 | } |
| 167 | auto&& op = static_cast<const Subtensor&>(def); |
| 168 | |
| 169 | auto items = op.items; |
| 170 | auto slice_itmes = op.slice_items; |
| 171 | TensorLayout out_layout = deduce_layout(inp.layout, items, slice_itmes); |
| 172 | |
| 173 | return {{{out_layout, inp_cn, {}}}, true}; |
| 174 | } |
| 175 | |
| 176 | SmallVector<TensorPtr> apply_on_physical_tensor( |
| 177 | const OpDef& def, const SmallVector<TensorPtr>& inputs, |
nothing calls this directly
no test coverage detected