🐛 Describe the bug There is an additional dimension appearing in the second return value of a torch.nn.LSTM layer when we apply torch.compile (in all backends) to it. The additional dimension happens to both tensors wrapped by a tuple in...
🚀 Feature I am working on medical image analysis, in which for data sample (i.e. medial image) it contains multiple samples (data + label) for training. How can I write my own dataset and dataloader to extract all the tensors from one im...
🐛 Describe the bug torch.sum always return 0 or first tensor element when running. This causes nlp sampling to be impossible. End to end example from transformers import pipeline generator = pipeline(model="distilgpt2", device=0) print(g...
The results.pandas() method exports all torch tensor results to dataframes at once (i.e. for batch-size 10 there will be 10 torch.tensors / pd.DataFrames), but note that each image would need to run it's own .to_json(), i.e. for the first image: results.pandas().xyxy[0].to...
return_tensors='pt', truncation=True ) input_ids.append(encoded_dict['input_ids']) attention_masks.append(encoded_dict['attention_mask']) return torch.cat(input_ids, dim=0), torch.cat(attention_masks, dim=0) input_ids, attention_masks = tokenize_comments(comments, tokenizer) # 將數據移...
import torch import torch.utils._pytree as pytree inputs = ((torch.ones(1), torch.tensor(2), torch.tensor(3), torch.tensor(3)), {}) _, y = pytree.tree_flatten_with_path(inputs) print(y) # TreeSpec(tuple, None, [TreeSpec(tuple, None, [*, # *, # *, # *]), # Tree...
The above would help to tightly type pd.DataFrame.Copy link sdeframond commented Nov 17, 2022 Honestly I don't think that A() should ever return something that's not an instance of A (or a subclass) It depends on the purpose of Mypy: Is it to enable people to do whateveer they wa...
(s): 1 Stepping: 2 CPU max MHz: 6700.0000 CPU min MHz: 800.0000 BogoMIPS: 6374.40 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs ...
video.seek(time_s, mode) self.stream = self.video.stream() # reset stream after seeking return def _iterate_stream(self): (frame, ) = next(self.stream) frame = torch.squeeze(frame, 0) return frame def __next__(self) -> torch.Tensor: frame = self._iterate_stream() return frame ...
cpu_reorder_pd.hpp" -+ -+namespace dnnl { -+namespace impl { -+namespace cpu { -+namespace aarch64 { -+ -+struct acl_reorder_obj_t { -+ arm_compute::NEReorderLayer reorder; -+ arm_compute::Tensor src_tensor; -+ arm_compute::Tensor dst_tensor; -+ arm_compute::Weig...