/aosp_15_r20/external/pytorch/torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/ |
H A D | embedding_bag.py | 102 per_sample_weights = kwargs.get("per_sample_weights") 123 per_sample_weights, 139 per_sample_weights, 168 per_sample_weights = kwargs.get("per_sample_weights") 180 if per_sample_weights is not None and not isinstance( 181 per_sample_weights, torch.Tensor 183 raise TypeError("per_sample_weights need to be torch.Tensor") 207 if per_sample_weights is not None and per_sample_weights.size() != input.size(): 209 … f"per_sample_weights size {per_sample_weights.size()} not equal to input size {input.size()}" 245 per_sample_weights, argument [all …]
|
H A D | _common.py | 116 gathered_per_sample_weights: per_sample_weights across all ranks. 136 per_sample_weights=gathered_per_sample_weights[i]
|
/aosp_15_r20/external/pytorch/test/nn/ |
H A D | test_embedding.py | 656 per_sample_weights = indices.ne(padding_idx).to(dtype).unsqueeze(-1) 657 res = embedding.mul(per_sample_weights).sum(dim=reduction_dim) 660 weights_sum = per_sample_weights.sum(dim=reduction_dim) 800 per_sample_weights = ( 805 per_sample_weights = (None,) 807 for p_s_weights, idx in itertools.product(per_sample_weights, (idx1, idx2)): 813 per_sample_weights=p_s_weights, 880 # Failure 1: mismatched embeddings / per_sample_weights dtype 884 per_sample_weights = torch.randn_like(input, dtype=torch.double, device=device) 887 es(input, offsets, per_sample_weights) [all …]
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/ |
H A D | EmbeddingBag.cpp | 493 // mul (scaling by per_sample_weights) 875 const std::optional<Tensor>& per_sample_weights, in check_arguments() argument 899 if (per_sample_weights.has_value() && per_sample_weights.value().defined()) { in check_arguments() 902 "embedding_bag: per_sample_weights only supported with mode='sum'"); in check_arguments() 904 per_sample_weights.value(),"per_sample_weights", 1); in check_arguments() 906 TORCH_CHECK(per_sample_weights.value().dim() == 1); in check_arguments() 907 TORCH_CHECK(per_sample_weights.value().numel() == indices.numel()); in check_arguments() 972 const std::optional<Tensor>& per_sample_weights, in make_offset2bag_out() argument 976 bool fast_path_sum = is_fast_path(weight, per_sample_weights, output, padding_idx); in make_offset2bag_out() 1028 const std::optional<Tensor>& per_sample_weights, in make_offset2bag() argument [all …]
|
H A D | EmbeddingBag.h | 30 const std::optional<Tensor>& per_sample_weights, 57 const std::optional<Tensor>& per_sample_weights, 132 const std::optional<Tensor>& per_sample_weights = std::nullopt, 148 const std::optional<at::Tensor>& per_sample_weights,
|
H A D | NonSymbolicBC.h | 19 …freq, int64_t mode, bool sparse, const std::optional<at::Tensor> & per_sample_weights, int64_t pad… 20 …cale_grad_by_freq, int64_t mode, const std::optional<at::Tensor> & per_sample_weights, int64_t pad…
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/cuda/ |
H A D | EmbeddingBag.cu | 60 // per_sample_weights are contiguous. 110 // per_sample_weights are contiguous. 117 const scalar_t* per_sample_weights, int64_t per_sample_weights_stride, in EmbeddingBag_updateOutputKernel_sum_mean() argument 144 if (per_sample_weights) { in EmbeddingBag_updateOutputKernel_sum_mean() 146 per_sample_weights[emb * per_sample_weights_stride]); in EmbeddingBag_updateOutputKernel_sum_mean() 175 const Tensor& per_sample_weights, in embedding_bag_backward_cuda_sum_avg() argument 236 bag_size, per_sample_weights); in embedding_bag_backward_cuda_sum_avg() 316 const Tensor& per_sample_weights = *per_sample_weights_maybe_owned; in _embedding_bag_forward_only_cuda() local 325 per_sample_weights, in _embedding_bag_forward_only_cuda() 350 const Tensor& per_sample_weights = *per_sample_weights_maybe_owned; in _embedding_bag_cuda() local [all …]
|
H A D | EmbeddingBackwardKernel.cu | 85 const scalar_t* per_sample_weights, int64_t per_sample_weights_stride, in compute_grad_weight_bags() argument 110 if (per_sample_weights) { in compute_grad_weight_bags() 111 scale *= per_sample_weights[origRow * per_sample_weights_stride]; in compute_grad_weight_bags() 222 const Tensor &per_sample_weights) { in embedding_backward_cuda_kernel() argument 327 per_sample_weights.defined() ? per_sample_weights.const_data_ptr<scalar_t>() : NULL, in embedding_backward_cuda_kernel() 328 per_sample_weights.defined() ? per_sample_weights.stride(0) : 0, in embedding_backward_cuda_kernel()
|
/aosp_15_r20/external/pytorch/benchmarks/operator_benchmark/pt/ |
H A D | qembedding_bag_lookups_test.py | 146 self.per_sample_weights = ( 169 "per_sample_weights": self.per_sample_weights, 183 per_sample_weights: Optional[torch.Tensor], 193 per_sample_weights=per_sample_weights, 258 self.per_sample_weights = ( 281 "per_sample_weights": self.per_sample_weights, 295 per_sample_weights: Optional[torch.Tensor], 305 per_sample_weights=per_sample_weights,
|
/aosp_15_r20/external/pytorch/test/distributed/_shard/sharded_tensor/ops/ |
H A D | test_embedding_bag.py | 77 per_sample_weights = None 79 per_sample_weights = torch.rand(*input_size).cuda(self.rank) 109 per_sample_weights=per_sample_weights, 116 per_sample_weights=per_sample_weights, 141 per_sample_weights=per_sample_weights, 152 per_sample_weights=per_sample_weights,
|
/aosp_15_r20/external/pytorch/torch/csrc/api/include/torch/nn/functional/ |
H A D | embedding.h | 98 const Tensor& per_sample_weights, in embedding_bag() argument 103 auto per_sample_weights_ = per_sample_weights; in embedding_bag() 107 "embedding_bag: If per_sample_weights (", in embedding_bag() 159 "embedding_bag: per_sample_weights was not null. ", in embedding_bag() 160 "per_sample_weights is only supported for mode='kSum' (got mode='", in embedding_bag() 204 options.per_sample_weights(),
|
/aosp_15_r20/external/pytorch/torch/nn/modules/ |
H A D | sparse.py | 272 …For bags of constant length, no :attr:`per_sample_weights`, no indices equal to :attr:`padding_idx… 284 reduction as specified by ``mode``. If :attr:`per_sample_weights` is passed, the 286 :attr:`per_sample_weights`. 298 … ``"sum"`` computes the weighted sum, taking :attr:`per_sample_weights` 431 per_sample_weights: Optional[Tensor] = None, 439 per_sample_weights (Tensor, optional): a tensor of float / double weights, or None 440 … to indicate all weights should be taken to be ``1``. If specified, :attr:`per_sample_weights` 472 per_sample_weights,
|
/aosp_15_r20/external/pytorch/torch/csrc/api/include/torch/nn/options/ |
H A D | embedding.h | 131 /// bag. ``"kSum"`` computes the weighted sum, taking `per_sample_weights` 172 /// bag. ``"kSum"`` computes the weighted sum, taking `per_sample_weights` 216 /// bag. ``"kSum"`` computes the weighted sum, taking `per_sample_weights` 224 /// be taken to be 1. If specified, `per_sample_weights` must have exactly the 227 TORCH_ARG(torch::Tensor, per_sample_weights) = Tensor();
|
/aosp_15_r20/external/pytorch/torch/csrc/jit/runtime/static/ |
H A D | passes.cpp | 452 …l scale_grad_by_freq=False, int mode=0, bool sparse=False, Tensor? per_sample_weights=None, bool i… in TORCH_LIBRARY_FRAGMENT() 455 …r offsets, bool scale_grad_by_freq, int mode, bool sparse, Tensor? per_sample_weights, bool includ… in TORCH_LIBRARY_FRAGMENT() 1306 …graph(%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %incl… in RemoveUnnecessaryEmbeddingBagOutputs() 1307 …%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %include_la… in RemoveUnnecessaryEmbeddingBagOutputs() 1310 …graph(%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %incl… in RemoveUnnecessaryEmbeddingBagOutputs() 1311 …%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %include_la… in RemoveUnnecessaryEmbeddingBagOutputs() 1318 …graph(%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %incl… in RemoveUnnecessaryEmbeddingBagOutputs() 1319 …%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %include_la… in RemoveUnnecessaryEmbeddingBagOutputs() 1322 …graph(%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %incl… in RemoveUnnecessaryEmbeddingBagOutputs() 1323 …%weight, %indices, %offsets, %scale_grad_by_freq, %mode, %sparse, %per_sample_weights, %include_la… in RemoveUnnecessaryEmbeddingBagOutputs()
|
/aosp_15_r20/external/pytorch/torch/ao/nn/quantized/modules/ |
H A D | embedding_ops.py | 310 per_sample_weights: Optional[Tensor] = None, 321 per_sample_weights, 333 per_sample_weights,
|
/aosp_15_r20/external/pytorch/torch/ao/nn/quantized/reference/modules/ |
H A D | sparse.py | 129 per_sample_weights: Optional[Tensor] = None, 141 per_sample_weights,
|
/aosp_15_r20/external/pytorch/torch/ |
H A D | _meta_registrations.py | 3356 per_sample_weights=None, argument 3384 if per_sample_weights is not None: 3387 lambda: "embedding_bag: per_sample_weights only supported with mode='sum'", 3390 per_sample_weights.dtype == weight.dtype, 3391 …lambda: f"expected weight ({weight.dtype}) and per_sample_weights ({per_sample_weights.dtype}) to … 3394 per_sample_weights.ndim == 1, 3395 lambda: f"expected per_sample_weights to be 1D tensor, got {per_sample_weights.ndim}D", 3398 per_sample_weights.numel() == indices.numel(), 3400 f"expected per_sample_weights.numel() ({per_sample_weights.numel()} " 3432 fast_path_sum = is_fast_path(weight, per_sample_weights, output, padding_idx) [all …]
|
/aosp_15_r20/external/pytorch/torch/csrc/inductor/aoti_torch/generated/ |
H A D | c_shim_cpu.h | 22 …cale_grad_by_freq, int64_t mode, int32_t sparse, AtenTensorHandle* per_sample_weights, int32_t inc… 23 …ights, int32_t scale_grad_by_freq, int64_t mode, AtenTensorHandle* per_sample_weights, int64_t pad… 24 …cale_grad_by_freq, int64_t mode, int32_t sparse, AtenTensorHandle* per_sample_weights, int32_t inc…
|
H A D | c_shim_cuda.h | 25 …cale_grad_by_freq, int64_t mode, int32_t sparse, AtenTensorHandle* per_sample_weights, int32_t inc… 26 …ights, int32_t scale_grad_by_freq, int64_t mode, AtenTensorHandle* per_sample_weights, int64_t pad… 27 …cale_grad_by_freq, int64_t mode, int32_t sparse, AtenTensorHandle* per_sample_weights, int32_t inc…
|
/aosp_15_r20/external/pytorch/torch/nn/ |
H A D | functional.py | 2563 per_sample_weights: Optional[Tensor] = None, 2594 per_sample_weights (Tensor, optional): a tensor of float / double weights, or None 2595 … to indicate all weights should be taken to be 1. If specified, :attr:`per_sample_weights` 2622 - :attr:`per_sample_weights` (Tensor, optional). Has the same shape as :attr:`input`. 2646 if has_torch_function_variadic(input, weight, offsets, per_sample_weights): 2649 (input, weight, offsets, per_sample_weights), 2658 per_sample_weights=per_sample_weights, 2673 if per_sample_weights is not None and input.size() != per_sample_weights.size(): 2675 f"embedding_bag: If per_sample_weights ({per_sample_weights.shape}) is not None, " 2701 if per_sample_weights is not None: [all …]
|
/aosp_15_r20/external/pytorch/test/ |
H A D | test_meta.py | 1598 per_sample_weights=None, 1618 per_sample_weights = None 1623 …weight, indices, offsets, scale_grad_by_freq, mode, sparse, per_sample_weights, include_last_offse… 1630 scale_grad_by_freq, mode, per_sample_weights, padding_idx 1635 scale_grad_by_freq, mode, per_sample_weights, padding_idx 1646 per_sample_weights = torch.randn(5, requires_grad=True) 1651 …weight, indices, offsets, scale_grad_by_freq, mode, sparse, per_sample_weights, include_last_offse…
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/quantized/ |
H A D | library.cpp | 136 …grad_by_freq=False, int mode=0, bool pruned_weights=False, Tensor? per_sample_weights=None, Tensor… in TORCH_LIBRARY() 137 …grad_by_freq=False, int mode=0, bool pruned_weights=False, Tensor? per_sample_weights=None, Tensor… in TORCH_LIBRARY() 138 …grad_by_freq=False, int mode=0, bool pruned_weights=False, Tensor? per_sample_weights=None, Tensor… in TORCH_LIBRARY() 139 …grad_by_freq=False, int mode=0, bool pruned_weights=False, Tensor? per_sample_weights=None, Tensor… in TORCH_LIBRARY() 140 …grad_by_freq=False, int mode=0, bool pruned_weights=False, Tensor? per_sample_weights=None, Tensor… in TORCH_LIBRARY()
|
/aosp_15_r20/external/pytorch/torch/ao/nn/qat/modules/ |
H A D | embedding_ops.py | 180 def forward(self, input, offsets=None, per_sample_weights=None) -> Tensor: argument 190 per_sample_weights,
|
/aosp_15_r20/external/pytorch/torch/csrc/api/src/nn/modules/ |
H A D | embedding.cpp | 138 const Tensor& per_sample_weights) { in forward() argument 148 per_sample_weights, in forward()
|
/aosp_15_r20/external/pytorch/torch/onnx/ |
H A D | symbolic_opset18.py | 237 per_sample_weights, argument 249 per_sample_weights,
|