sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
c8f168e122e049b21cd242be5eb691f41de7bb01ba28e878f223f0d2886e14cf
C++
3,082
65
#include <ATen/native/MathBitsFallback.h> #include <ATen/native/MathBitFallThroughLists.h> namespace at::native { struct ConjFallback : MathOpFallback { ConjFallback() : MathOpFallback(DispatchKey::Conjugate, "conjugate") {} bool is_bit_set(const Tensor& tensor) override { return tensor.is_conj(); } }; stat...
5b081fa8f1ac45416152fddf0305e98147c22016eecb3915f665fab9ab06b603
C++
3,084
121
/*************************************************************************** * * Author: "Jasenko Zivanov" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foun...
f0126c8fcd602be016dc2fe3923efdd5a4a28491e2ed5399e9014922056f59f6
C++
3,122
96
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
268bfde860aebf2db4f1c10e17f45bc6da5ef51b8032319561ade41537a40615
C++
3,205
99
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/ExpandUtils.h> #include <ATen/Dispatch.h> #include <ATen/Parallel.h> #include <ATen/cpu/vec/functional.h> #include <ATen/cpu/vec/vec.h> #include <ATen/native/cpu/SampledAddmmKernel.h> #include <ATen/native/cpu/utils.h> #include <c10...
c548aca67f3b4abee7193f5d0e79d239871b8c5d6c9ec70ba1df8358d5de7721
C++
3,219
111
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/native/PoolingChecks.h> #include <ATen/native/cpu/MaxUnpoolKernel.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/empty.h> #include <ATen/ops/max_unpool2d_na...
c072b672f04dedd2998fd79652eaf2560f0b325839d345eaeb8d51f187adae40
C++
3,221
111
//*********************************************************************************************** // // Copyright (c) 1993-1997 Axon Instruments. // All rights reserved. // Permission is granted to freely to use, modify and copy the code in this file. // //************************************************...
5dc79743e12809cbf8012a5f0c3a1a32503d808e4124b17349ef5b41d12e70e0
C++
3,236
98
// Returns the frequency of elements of input non-negative integer tensor. #define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Dispatch.h> #include <c10/util/irange.h> #include <limits> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #...
0144f16a682e45ff7be74c9bc6fe0cfe94dc0071dfd04b97b10370dba30a97eb
C++
3,239
90
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/Cross.h> #include <ATen/core/Tensor.h> #include <ATen/TensorMeta.h> #include <ATen/WrapDimUtils.h> #include <ATen/ExpandUtils.h> #include <ATen/MemoryOverlap.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h...
b4fb72a79fb0c77aba080e3fc71a3863627c9cfb38ed0d801f2f914bf9f852d3
C++
3,245
83
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/GridSampler.h> #include <utility> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/empty.h> #include <ATen/ops/empty_like.h> #include <ATen/ops/grid_sampler_2d_backward_native.h> ...
c0a758321a5f1d1f2cbad91f68151cd4021527ac0e2746d47eb44f2a39c0ceaa
C++
3,248
85
#include <benchmark/benchmark.h> #include <c10/util/irange.h> #include <torch/csrc/jit/passes/xnnpack_rewrite.h> #include <torch/csrc/autograd/generated/variable_factories.h> #include <torch/csrc/jit/api/module.h> #include <vector> static void stateful_conv1d(benchmark::State& state) { const size_t input_channels =...
09150aaa973d0126f489ef71abab536bc8e797e05f5f7e0ec21d70a33b150480
C++
3,260
94
#define TORCH_ASSERT_NO_OPERATORS #include <ATen/cuda/EmptyTensor.h> #include <ATen/cuda/CUDAContext.h> #include <ATen/EmptyTensor.h> namespace at::detail { TensorBase empty_cuda( IntArrayRef size, ScalarType dtype, std::optional<Device> device_opt, std::optional<c10::MemoryFormat> memory_format_opt) ...
0b94c0529cb8bb76ea78d3bb7d9370a75b1a497b568c3bf184daf2dfdae9d3bc
C++
3,266
103
// This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, ...
edc26432748ae0b98673d089f2bf0e08c5b6baa5d9c7efcb4745f7ee29ce074a
C++
3,272
99
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/Config.h> #include <ATen/InferSize.h> #include <ATen/core/Tensor.h> #include <c10/core/SymIntArrayRef.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_mkldnn_reshape_native.h> #include <ATen/ops/_mkldnn_transpose_na...
44eed050a0d16fb6693a9c534bb71f135eee7ce1048c28e7b11de71591ff07bf
C++
3,283
100
#include "udp_client.h" #include <iostream> #include <cstring> #include <arpa/inet.h> #include <unistd.h> // For close() UDPClient::UDPClient(const std::string& ip_address, int port) : udp_socket_(-1), assigned_port_(port) { // Create the UDP socket udp_socket_ = socket(AF_INET, SOCK_DGRAM, 0); if (udp_so...
eef0f02e63aecf4edc1909938c2535130508ca96784df61760f5d51a2ddad172
C++
3,302
84
#include "helper_functions.h" // Function to get the current timestamp std::string get_timestamp() { auto now = std::chrono::system_clock::now(); auto now_time_t = std::chrono::system_clock::to_time_t(now); auto now_us = std::chrono::duration_cast<std::chrono::microseconds>(now.time_since_epoch()) % 10000...
4430a3737d1f142ff3c81afb15e65751a281cd1b4940191d02e19fab84cc4a96
C++
3,330
127
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <cpuinfo.h> #include <gtest/gtest.h> #include <qnnpack/isa-checks.h> #include <qnnpack/u8cl...
6b317195eb4f05914d92dcf12070d06f1883fdb761d17e31ab0501a4797897d8
C++
3,366
125
#include "subtomo_mpi.h" #include <src/jaz/tomography/dynamo/catalogue.h> #include <src/jaz/tomography/projection/projection.h> #include <src/jaz/tomography/projection/Fourier_backprojection.h> #include <src/jaz/tomography/reconstruction.h> #include <src/jaz/tomography/tomogram_set.h> #include <src/jaz/tomography/tomo_...
c0a6350dd10f4f63e6fde3ec6271f4ba27c0ca8d8ecca71360aa8bd4a842853c
C++
3,373
102
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/TensorMeta.h> #include <ATen/native/UpSample.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_upsample_lanczos2d_aa.h> #include <ATen/ops/_upsample_lanczos2d...
4d894ff383c7216d353f2b948889c320b678b03b202f0c0bc524f326d1bafeec
C++
3,390
102
// This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be use...
dc35db01f6f21624b108ee8d63dac63416256c68e310e179b6c33e389311d98c
C++
3,391
120
/* Portions of this code are under: Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #include "src/acc/hip/hip_benchmark_utils.h" //Non-concurrent benchmarking tools (only for Linux) #include <vector> #include <time.h> #include <string> #include <signal.h> #include "src/macros.h" #include "...
7525298d96601f6af58a721f5e008d53070ccc5f16e3663f9428c802a520e395
C++
3,396
105
#include "gcmi_kernels.hpp" #include <algorithm> #include <cmath> #include <cstddef> #include <numeric> #include <vector> #include <omp.h> namespace gcmi { namespace { inline double ndtri(double p) { // Peter J. Acklam's inverse-normal approximation, mirrored from the // Python/Numba batch kernel for consi...
e21dd3fe305ed197cc58f33db2c41c04c5e1ef8b6e230d9a525924f5c30b7a3b
C++
3,400
165
#include "fcc_computation.h" #include <src/ctf.h> #include <src/jaz/optics/damage.h> #include <src/jaz/math/fcc.h> #include <src/jaz/tomography/tomogram.h> #include <src/jaz/tomography/motion/proto_alignment.h> #include <src/jaz/tomography/projection_IO.h> #include <src/jaz/tomography/prediction.h> #include <src/jaz/to...
9aa2b9ca3be3e9f3eb6e32aac811cbb91600e6c3fc23da387ac902ca4ebbfe72
C++
3,401
82
#include <ATen/ThreadLocalState.h> #if !defined(CAFFE2_IS_XPLAT_BUILD) && !defined(C10_MOBILE) && !defined(BUILD_LITE_INTERPRETER) #include <ATen/autocast_mode.h> #endif #include <ATen/record_function.h> #include <ATen/SavedTensorHooks.h> #include <ATen/FunctionalTensorWrapper.h> #include <ATen/DTensorState.h> names...
a8df99aee7d56c0f294c04ca32775dec0972541d116a6ccb9af08363b43deb6f
C++
3,408
104
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Context.h> #include <torch/library.h> #include <ATen/native/quantized/cpu/QuantizedOps.h> #include <ATen/native/quantized/cpu/init_qnnpack.h> #include <ATen/native/quantized/cpu/QnnpackUtils.h> #include <caffe2/utils/threadpool/pthr...
d7e33b6d61ac31c6da96c8b3f44f4589b76f7d553de094f56571db8ca1f00b8e
C++
3,417
122
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
f379c7a333fdfb203421639aadef749eb3838e0872d49e995a8c3ed482b2ffaf
C++
3,418
110
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/TensorUtils.h> #include <ATen/native/cuda/ScanKernels.h> #include <ATen/native/ReduceOps.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_cummax_helper_nati...
53e21e9285f050e227c92d4630c1fee8d76c5ccb3be2b62687f9ca7f17f462df
C++
3,428
118
/*************************************************************************** * * Author: "Jasenko Zivanov" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foun...
7aed5f0fd0bc27c15ac63cb4d5cefb85aa12288f8c30e772ba261ce4afe8ab26
C++
3,443
135
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <gtest/gtest.h> #include "softargmax-operator-tester.h" #include <qnnpack/params.h> TEST(...
7e6e16c3e0ea45230a8d7f8177dcc4dea133fc336c4738d727b5949e3329e8b1
C++
3,452
102
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/TensorModeKernel.h> #include <ATen/cuda/CUDAConfig.h> #include <ATen/native/CanUse32BitIndexMath.h> #include <ATen/native/ReduceOpsUtils.h> #include <ATen/native/Resize.h> #include <ATen/native/TensorCompare.h> constexpr int64_t MAX_BLOCK_SIZE = AT_...
beba97b0fa4ffef9a3d15b590659a51c81b798c3d9478e81dfdbcdf6cb0f7b8a
C++
3,462
107
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/Activation.h> #include <ATen/core/DimVector.h> #include <ATen/core/Tensor.h> #include <ATen/TensorIterator.h> #include <ATen/WrapDimUtils.h> #include <ATen/native/Resize.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/...
c943e7df242cce4c6a34b484f9f69f0b45b2f93f81b605f271f321b90a3da768
C++
3,479
102
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/Resize.h> #include <ATen/core/Tensor.h> #include <ATen/native/ResizeCommon.h> #include <c10/cuda/CUDACachingAllocator.h> #include <c10/cuda/CUDAGuard.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/NativeFunctions.h> #else #include <ATen/ops/resiz...
4b41c70967d0c2b54a0f16943f124556c840de0856f2b83f180f505677ad6a7a
C++
3,480
115
/* * mymodule.cpp * * This file is part of NEST. * * Copyright (C) 2004 The NEST Initiative * * NEST is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at y...
f9604d316308d5aada72ff4ae61f986ee70a15906237a03e4ac6728f4d9a383b
C++
3,488
97
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
be131dc2381d5d54bb875f79b5503b19f5bc87c323f37d0018040f1bbd45aa52
C++
3,495
165
#include <unistd.h> #include <string.h> #include <fstream> #include <src/args.h> #include <src/image.h> #include <src/jaz/single_particle/damage_helper.h> #include <src/jaz/single_particle/image_log.h> #include <omp.h> using namespace gravis; int main(int argc, char *argv[]) { IOParser parser; parser.setComman...
94f772c7a589f2ce54f2e0f727c90f6056881d372a298b81f952336698ca6e82
C++
3,496
96
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/Distributions.h> #include <ATen/TensorIterator.h> #include <ATen/cuda/CUDAGeneratorImpl.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_dirichlet_grad_native.h> #include <ATe...
8034ce1999c6ad3fd66b44f99cd0ecdb9d8d9cc4d1be0957a742754f2382bb30
C++
3,503
99
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
cc049b22725ea839686ba7904f2fbedf1c084c61f68248fec4b7b0dcdacc079f
C++
3,510
101
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/ExpandUtils.h> #include <ATen/native/Resize.h> #include <ATen/quantized/Quantizer.h> #include <c10/core/QScheme.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/o...
33fd47a9b6b0801c33d5b727006a306d2a766f88b9cdc2eba738d8aa083c64ce
C++
3,535
78
// Copyright (c) Facebook, Inc. and its affiliates. // All rights reserved. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <ATen/ATen.h> #include <ATen/functorch/BatchedFallback.h> #include <ATen/core/dispatch/Dispatcher.h...
e094c22d4a0f2f0a1c5d1b3eaf7fcf795ad44f40213e988b02b9bb53aec54ccf
C++
3,551
74
// Copyright (c) Facebook, Inc. and its affiliates. // All rights reserved. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #include <ATen/functorch/BatchRulesHelper.h> namespace at::functorch { template <typename Func> static std...
962686947d3f773a335f738b2b86ad715c225b67d4b9682efae53420f733fe59
C++
3,556
91
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/native/AdaptivePooling.h> #include <c10/util/irange.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/adaptive_max_pool2d_backward_native.h> #include <ATen/ops...
b4b174d6b0ae8b2ad1905175972ec53388c20c9cef67c9e102fcc5541ef83f05
C++
3,563
135
#include <ATen/Parallel.h> #include <ATen/Config.h> #include <ATen/PTThreadPool.h> #include <ATen/Version.h> #include <c10/util/env.h> #include <sstream> #include <thread> #if AT_MKL_ENABLED() #include <mkl.h> #endif #ifdef _OPENMP #include <omp.h> #endif #if defined(__APPLE__) && defined(__aarch64__) && !defined(...
c52af810837e0d4df9b52f88f54de6dc67718955f55f107b7b4e7b5c42d34e52
C++
3,590
110
#include <ATen/mps/MPSDevice.h> #include <ATen/native/mps/operations/GemmHeuristics.h> namespace at::native::mps { GemvConfig GemvPolicy::clamp_vec(GemvConfig cfg, int64_t align) { while (cfg.vec > 1 && (align & (cfg.vec - 1))) { cfg.vec >>= 1; } return cfg; } namespace { GemvConfig t2d(int nsimd, int kq)...
ca47f09c11f5855169f5e85f4bd944128d4732b2b850d7197da7d0de3d9877b1
C++
3,599
113
#include <ATen/DeviceGuard.h> #include <torch/library.h> #include <FusionUtils.h> namespace at::native::xpu { std::tuple<std::vector<int64_t>, std::vector<int64_t>, std::vector<int64_t>> collapse_in_out_dim(at::Tensor input, int64_t dim, at::Tensor weight) { // dim collapse, e.g. [B, M, K] -> [BM, K] std::vector...
f145ca3ceba8366de9441afb3d661b02cbc8867508e22d089626bc5f250da6de
C++
3,637
138
// Copyright (C) 1996,1997,2026 Bernd Feige // This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING). #include "Point.hh" #ifndef IGNORE_RESULT /* Suppress -Wunused-result for functions declared with warn_unused_result * (gcc does not honour a plain (void) cast for these). */ #define IGNORE_RE...
f97eb387341903d1482ac8677938e13b93560b14c3eef97f08eb8ae6a10067ea
C++
3,647
83
/** Pairwise dot product along dimension 1. */ #include "mex.h" #include <vector> #include <cstdint> template<typename Number> void dotProduct(const mxArray* mat_X, const mxArray* mat_Y, mxArray* mat_XdotY, const bool includeNaN) { // Get inputs and dimensions const mwSize nRows = mxGetM(...
4d53d2278572a42a80f97b05dfc4373e6d3d322c21f926d5e5faa7b338f9cbbd
C++
3,717
111
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Dispatch.h> #include <ATen/OpMathType.h> #include <ATen/Parallel.h> #include <ATen/TensorIterator.h> #include <ATen/cpu/vec/vec.h> #include <ATen/cpu/vec/functional.h> #include <ATen/native/cpu/utils.h> #include <ATen/native/transfo...
b761de80c01ccefefb3befb4e80c9b01035bc3121d1c13f092c851a4aa6a39de
C++
3,717
119
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
05f1d64b04ed40bad96d94843563a7566c7e2c5bd7c06beef3dfe77c1c3b4e00
C++
3,723
117
#include <ATen/core/dispatch/Dispatcher.h> #include <ATen/core/VariableHooksInterface.h> #include <torch/library.h> /* * This file implements a variable fallback kernel for custom operators. * Since tensors always have the Autograd set, but custom operators * usually don't have a kernel registered for Autograd, the...
0e8b8a0e8fc3983e01038de398e625fc286f62ff7802b8046fdab050d9df0bfe
C++
3,760
122
#include <pytorch_qnnpack.h> #include <qnnpack_func.h> #include <cstring> namespace qnnpack { struct q8gemm_context { size_t k; size_t k_stride; size_t n; size_t n_stride; const uint8_t* a; size_t a_stride; const uint8_t* packed_w; uint8_t* c; size_t c_stride; union pytorch_qnnp_conv_quantization_p...
21af4c487051ffa6445adf7c59b9d46284a79c86d70e4c472f289d8d2248dc41
C++
3,762
110
// Copyright 2008 Google Inc. // All Rights Reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions a...
7fd23a7f6a28851d27ee62f7c7c8ada31eb5205e0f99ab857a302febfb5dbec9
C++
3,772
117
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/ReduceOps.h> #include <ATen/native/ReduceOps.h> #include <ATen/native/ReduceAllOps.h> #include <ATen/native/ReduceOpsUtils.h> #include <ATen/native/TensorCompare.h> #include <ATen/Context.h> #include <ATen/TensorUtils.h> #include <ATen/TensorIterat...
14d59569e52c0d96ec7f8c3bf57a17db0ced8f60cd852336bb87857963ad74a8
C++
3,782
111
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Context.h> #include <ATen/native/quantized/cpu/QuantizedOps.h> #include <ATen/native/quantized/cpu/init_qnnpack.h> #include <ATen/native/quantized/cpu/QnnpackUtils.h> #include <caffe2/utils/threadpool/pthreadpool-cpp.h> #ifndef AT_...
3ba54c0861f8c90c414d2cc45ea74b1b0e210d09728f2db239ff4641cdbcf6a3
C++
3,785
181
#include <math.h> #include <Rcpp.h> #include <R.h> using namespace std; using namespace Rcpp; double difference(vector<double>& vec1, vector<double>& vec2) { double diff = 0; double a; int len = vec1.size(); for(int i = 0; i < len; i++) { a = vec1[i] - vec2[i]; diff += a * a; } return(diff); } vo...
3f9f5178a228e4df030b4b4f6bd24d1f6c54d571f65b2ae2f0585578c933312c
C++
3,797
143
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
de64e1e6257b401ec999eb4aa3a75301c62c223ade825922ad4aae14412e8b31
C++
3,799
85
#include <mex.h> #include "utilities.h" //========================================================================= // MatLab interface //========================================================================= void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // In/outpu...
c42c0be40b5f01f1e930982e8bdf5393c44fe21869296b85455abed96bd95c38
C++
3,809
139
// Copyright (C) 1996,1997,2018 Bernd Feige // This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING). #include "Triangls.hh" Triangles::Triangles() { } Triangles::Triangles(Point *pp1, Point *pp2, Point *pp3) { p1=pp1; p2=pp2; p3=pp3; } Triangles::Triangles(Triangle* tr) { p1=tr->p1; p2=tr...
eb4b9857380d4991406d29ddf7645c870590b998b2ea116ffda64988742b10d0
C++
3,816
116
// Adapted from interp.cpp from Caffe util by Pauline Luc // Originally developed by George Papandreou #define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/TensorMeta.h> #include <ATen/native/UpSample.h> #include <c10/util/irange.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Fun...
9842e7ebc7cc6fdd10e9c8f6ec1bd2e25f375d07ee81d5eabb55aabca496203b
C++
3,827
116
#define TORCH_ASSERT_NO_OPERATORS #include <ATen/native/cpu/ChannelShuffleKernel.h> #include <ATen/core/TensorBase.h> #include <ATen/Dispatch.h> #include <ATen/Parallel.h> #include <ATen/native/cpu/utils.h> #include <ATen/cpu/vec/vec.h> #include <c10/util/irange.h> namespace at::native { namespace { template <typen...
a24c81146fd4a92a2295bab26eaac26d0a170ff068d46b86035a72088273475d
C++
3,852
143
#include <unistd.h> #include <string.h> #include <fstream> #include <src/args.h> #include <src/image.h> #include <src/fftw.h> #include <src/complex.h> #include <src/metadata_table.h> #include <src/backprojector.h> #include <src/euler.h> #include <src/jaz/single_particle/vtk_helper.h> #include <src/jaz/single_particle...
0cfebf691655c0c190502b50760cf6f212a81026c2508383f82c661fa730c54f
C++
3,885
113
#include "../dep/laynii_lib.h" int show_help(void) { printf( "LN_TRIAL: Average trials of block design fMRI experiments. Assumes \n" " equi-distant blocks with identical rest and activity periods.\n" "\n" "Usage:\n" " LN_TRIAL -input timeseries.nii -trialdur 12 \n" " ../LN_TR...
50270d8464d5b1ef881d4ed014869b41082541f7769315d1764a2852db8fc12a
C++
3,903
143
/*************************************************************************** * * Author: "Jasenko Zivanov" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foun...
5d69bad90f81ebcd9f72831a35f1461ba9448456bce8d73b1e4044f99c7f0a42
C++
3,912
123
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/core/boxing/KernelFunction.h> #include <ATen/native/quantized/cpu/init_qnnpack.h> #include <ATen/native/quantized/cpu/QnnpackUtils.h> #include <caffe2/utils/threadpool/pthreadpool-cpp.h> #ifndef AT_PER_OPERATOR_HEADERS #include <AT...
e4b5025127b25f57084eaeb7b511d2f074e79528e2856826817c19d7784a42bc
C++
3,940
155
#include <src/jaz/single_particle/vtk_helper.h> #include <src/jaz/single_particle/obs_model.h> #include <src/jaz/single_particle/stack_helper.h> #include <src/metadata_table.h> #include <src/args.h> int main(int argc, char *argv[]) { std::string particlesFn, outPath; MetaDataTable particlesMdt; int nr_omp_threads;...
d7f455da935a697af4b6e48e146c262b18310529a4a61b982eecbb60d9d88c52
C++
3,945
158
#include "find_lattice.h" #include <src/jaz/image/filter.h> #include <src/jaz/image/normalization.h> #include <src/jaz/image/structure_tensor.h> #include <src/jaz/image/local_extrema.h> #include <src/jaz/tomography/projection/projection.h> #include <src/jaz/single_particle/vtk_helper.h> #include <omp.h> using namespa...
9ae6c83e8e58dde5f023c87f3e5966436d6c61f77f323d3f0c0f31c289a6f9cf
C++
3,977
192
#include "astigmatism_fit.h" AstigmatismFit::AstigmatismFit( const std::vector<BufferedImage<float>>& spectra, int num_threads, int k0, int k1, double Cs_px ) : spectra(spectra), num_threads(num_threads), k0(k0), k1(k1), Cs_px(Cs_px) { std::cout << spectra.size() << " frames." << std::endl; } vo...
1df34806343c06a15f4053776569642a087c6ec5111b58aa4f6f51ed0cd3f2f4
C++
3,992
150
// Copyright (C) 1996,1997,2011,2018 Bernd Feige // This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING). #include "Triangle.hh" Triangle::Triangle() { p1=p2=p3=(Point*)0; } Triangle::Triangle(Point *pp1, Point *pp2, Point *pp3) { p1=pp1; p2=pp2; p3=pp3; } Triangle::~Triangle() { p1=p2=p3...
316537e53142e981ccaeb2a9c7a7aef2483462c9a9b889a9117f0784027f32d4
C++
3,992
106
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #if defined(C10_MOBILE) && defined(USE_XNNPACK) #include <ATen/native/xnnpack/Engine.h> #endif #include <c10/util/Exception.h> #include <ATen/native/cpu/ChannelShuffleKernel.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #els...
251a1d7dbe35e6ee2a041076938ad4a8aa556f32a96a63ca161f2a2afd01055f
C++
4,019
237
#include "dynamo_particle.h" #include <src/jaz/math/Euler_angles_dynamo.h> #include <sstream> #define ONE_BASED_COORDS 1 #define OFF_BY_HALF_COORDS 1 using namespace gravis; DynamoParticle::DynamoParticle() : tag(0), aligned(0), averaged(0), dx(0), dy(0), dz(0), tdrot(0), tilt(0), narot(0), cc(0), cc2(0),...
38c9ed546ce50cc5e2eecff94d9a7908d3067686d3e23fcfd29c67f03e9f0124
C++
4,060
163
#include <unistd.h> #include <string.h> #include <fstream> #include <src/args.h> #include <src/image.h> #include <src/metadata_table.h> #include <src/jaz/single_particle/img_proc/filter_helper.h> #include <src/jaz/single_particle/stack_helper.h> #include <src/jaz/single_particle/obs_model.h> #include <src/jaz/single_...
d9abd9d61b50a7e5b4c8d169a03f7ee510c98a439cd810acfcf6db1c6f43d831
C++
4,071
100
#define TORCH_ASSERT_NO_OPERATORS #include <ATen/native/RangeFactories.h> #include <cmath> #include <ATen/Config.h> #include <ATen/Dispatch.h> #include <ATen/native/DispatchStub.h> #include <ATen/AccumulateType.h> #include <ATen/OpMathType.h> #include <ATen/cpu/vec/vec.h> #include <ATen/cpu/vec/functional.h> #include ...
a34556efcf217edf618e9a7f402ed85d9836b2371ef13c94074b6068f4d5bd10
C++
4,083
139
/*************************************************************************** * * Author: "Jasenko Zivanov" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foun...
bc63a0793c1167fd68a328345eb051a9b38a020d2b4e5f8394edcfea9f304a97
C++
4,089
183
#include "trajectory.h" #include <src/metadata_table.h> #include <src/jaz/tomography/particle_set.h> #include <src/jaz/util/zio.h> #include <src/jaz/util/log.h> #include <fstream> using namespace gravis; std::vector<Trajectory> Trajectory::read(std::string filename, ParticleSet& particleSet) { std::ifstream ifs(fil...
34287642acae3dc3fe6291f95be0c4dc4bb6a875c781ed869609606c54bfc4d6
C++
4,113
154
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Dispatch.h> #include <ATen/native/im2col.h> #include <ATen/native/im2col_shape_check.h> #include <c10/util/irange.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATe...
b392ae13185ded898bcbd1c6ed7582afe1b2f2118fce823750ca25add8ed7170
C++
4,128
175
/*************************************************************************** * * Author: "Jasenko Zivanov" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foun...
bfb0f890c0b3b0d0f954a0d17c2875d15027aa95c6786e742e444ef7d5e4a6ce
C++
4,141
132
// aten_interned_strings.h includes the names of all operators #undef TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/interned_strings.h> #include <cstring> #include <mutex> #include <string> #include <ATen/core/interned_strings_class.h> namespace c10 { const std::string& domain_prefix() { static const std:...
a0c38b5c3f12f17040f45885f62897830b48808f6fbcf8fbbdeaf4b9ac651f30
C++
4,143
189
#include "ctf_equiphase_fit.h" using namespace gravis; CtfEquiphaseFit::CtfEquiphaseFit( const BufferedImage<float> &spectrum, double pixelSize, double voltage, double Cs, double Q0, double mapScale, int num_threads, int k0, int k1) : spectrum(spectrum), num_threads(num_threads), k0(k0), k1(k...
009f8978ffd308baea4ebf0d138333e550e265762f9a8463d28e055ece146d92
C++
4,159
110
// Copyright 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions ...
47860e1b6ecc40ac0e8fbd0efb6acbe00eb0d37f0f9ea54b61db64529e970642
C++
4,163
130
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
a84b398d4bc18a8fb049c4dfba92d271d87bd494f3762a4041b5d385708a8885
C++
4,171
138
/*************************************************************************** * * Author: "Sjors H.W. Scheres" * MRC Laboratory of Molecular Biology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software F...
35f687243808e629acc563d47f1f3d9b32fc8cb77cb1c334a2dfde0842e76dbd
C++
4,196
171
#include "discover_motif.h" #include <src/jaz/image/filter.h> #include <src/jaz/image/normalization.h> #include <src/jaz/image/structure_tensor.h> #include <src/jaz/image/local_extrema.h> #include <src/jaz/tomography/projection/projection.h> #include <src/jaz/tomography/lattice/point_cloud.h> #include <src/jaz/tomogra...
52599d3370c7342f3012816f5d93a151666503affb66a17ce29d75d17bfb40d5
C++
4,202
176
#include "fiducials.h" #include <omp.h> using namespace gravis; std::vector<d3Vector> Fiducials::read( const std::string &filename, double pixelSize) { MetaDataTable metaDataTable; metaDataTable.read(filename); const int n = metaDataTable.numberOfObjects(); std::vector<d3Vector> out(n); for (int i = 0; i...
7718b197f10e7cf10bafbc78be0e933d78e17bfd3d6e1a3f424fcb5dc72d0eb7
C++
4,208
161
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <gtest/gtest.h> #include "leaky-relu-operator-tester.h" TEST(LEAKY_RELU_OP, zero_batch) { ...
14b2ff2d8afba31cec62652164269c8ac5ac68964b82f224cfa08803543769a7
C++
4,218
159
#include <src/args.h> #include <src/jaz/util/log.h> #include <src/jaz/tomography/projection/projection.h> #include <src/jaz/tomography/extraction.h> #include <src/jaz/tomography/optimisation_set.h> #include <src/jaz/tomography/particle_set.h> #include <src/jaz/tomography/tomogram_set.h> #include <src/jaz/tomography/rec...
070d1291d557b52ffab6956a7cd40e0511ec8564732deaad19f132f8f792b0bd
C++
4,243
126
#include <gtest/gtest.h> #include <ATen/ATen.h> #include <ATen/NativeFunctions.h> #include <ATen/Functions.h> #include <ATen/core/dispatch/Dispatcher.h> #include <ATen/core/op_registration/op_registration.h> #include <c10/util/irange.h> #include <torch/library.h> using namespace at; namespace { // This test file gi...
bd4b8824c8264352355ae97eba75b73cf6b3c8ada113d9b2d33238cd7fd3c7ea
C++
4,246
141
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <torch/custom_class.h> #include <ATen/native/ao_sparse/quantized/cpu/fbgemm_utils.h> #include <ATen/native/ao_sparse/quantized/cpu/packed_params.h> #include <ATen/native/ao_sparse/quantized/cpu/qnnpack_utils.h> #ifndef AT_PER_OPERATOR_H...
28020b9b84d1cd99bf91599845ad43b5b7a9b8032251e726792ee88356efc3f3
C++
4,271
108
/* * Npp_performance_profiler.cpp * * Created on: Sep 12, 2017 * Author: arios */ #include "npp_performance_profiler.hpp" #include "npp_log_utilities.cpp" Npp_performance_profiler* Npp_performance_profiler::instance = 0; Npp_performance_profiler::Npp_performance_profiler() { //time_start = new std::vecto...
fbca8fee239c6522c830e9c8a32847d0b49364977bf152ddebbaec3fcca164e4
C++
4,273
200
#include <src/jaz/single_particle/tomo/tomo_stack.h> #include <src/jaz/single_particle/tomo/backprojection_helper.h> #include <src/jaz/single_particle/vtk_helper.h> #include <src/jaz/single_particle/volume_converter.h> using namespace gravis; void drawPoint(Volume<RFLOAT>& dest, d3Vector p, RFLOAT val); int m...
83969715af8875f386b2bffd4aff48a41c326834b8e51ec5c7429b794446577f
C++
4,294
140
#include "../dep/laynii_lib.h" int N_rand = 1000; double_t lower = -10; double_t upper = 10; double verteilung(double x); typedef double (*Functions)(double); Functions pFunc = verteilung; double_t arb_pdf_num(int N_rand, double (*pFunc)(double), double_t lower, double_t upper); double adjusted...
d2775baaeb19b651989fb809177241359971a9c619af6d8e1b95547ef6265c9f
C++
4,319
101
/* mex Function nakeinterp1.c */ ////////////////////////////////////////////////////////////////////////// // mex function nakeinterp1.c // Dichotomy search of indices // Calling: // idx=nakeinterp1(x, y, xi); // where x, y and xi are double column vectors // x must be sorted in ascending order; x and y have th...
830e855637709080f616e37fa0790ffb039e8579891a6b048d74e1f159fbe2da
C++
4,340
118
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/FunctionOfAMatrixUtils.h> #include <ATen/core/Tensor.h> #include <ATen/TensorIterator.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/_compute_linear_combination_native.h> #includ...
baf8d054ce8617c3d94d2a747c3be285d9a147a3d8b1161b865f95fb0ef855f9
C++
4,343
91
/** Converts a given matrix to a list of lower-triangular elements. */ #include "mex.h" #include <vector> #include <cmath> #include <cstdint> template<typename Number> void extractLowerTriangle(const mxArray* mat_M, const mwSize k, mxArray* mat_tril) { // Get inputs and dimensions const mwSize ...
a8b22d2db2a113f794d9cf7a703133960fe38418423743b093d0406903bb24d5
C++
4,356
142
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <ATen/Dispatch.h> #include <ATen/Parallel.h> #include <ATen/native/Repeat.h> #include <c10/util/irange.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/repeat_inter...
38f6f625b08a1d0f3513ed8ba6238ee59e0e2c904c998888e4fc6de903d00b81
C++
4,364
127
#include "../dep/laynii_lib.h" int show_help(void) { printf( "LN_CORREL2FILES: Estimate the voxel wise correlation of two timeseries.\n" "\n" "Usage:\n" " LN_CORREL2FILES -file1 file1.nii -file2 file2.nii \n" " ../LN_CORREL2FILES -file1 lo_Nulled_intemp.nii -file2 lo_BOLD_intemp.nii \n" ...
b1be17a2da79a58fdea0a7d03d178e6dc1358daf5b1cce64565657244a7162b1
C++
4,376
154
#include "local_particle_refine.h" #include <src/jaz/util/zio.h> #include <src/jaz/util/log.h> #include <src/jaz/tomography/particle_set.h> #include <src/jaz/tomography/extraction.h> #include <src/jaz/tomography/prediction.h> #include <src/jaz/tomography/tomo_ctf_helper.h> #include <src/jaz/math/Zernike_helper.h> #incl...
59660e9db8eb469518adc5fdd58de4035c949091568ccfc2898402502751b8c0
C++
4,395
126
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/TensorTopK.h> #include <ATen/core/Tensor.h> #include <ATen/TensorMeta.h> #include <ATen/TensorUtils.h> #include <ATen/WrapDimUtils.h> #include <ATen/native/cuda/Sort.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/Nati...
bb3473543ffd6e4aed0b5d2de9d821316e15c8a2ae371b2897ce625be047c613
C++
4,398
146
#include "color_helper.h" #include <src/macros.h> #include <cmath> #ifdef HAVE_PNG #include <src/jaz/gravis/tImage.h> #endif using namespace gravis; dRGB ColorHelper::signedToRedBlue(double d, double scale, double rbFract) { const double d_rb = d / (scale * rbFract); const double d_g = (std::abs(d)/scale - rbFra...
2fd3db24ea85ea37af3e39140f8ad9fbcf8a6337537d50d0767a6ef256dce629
C++
4,403
135
#include <pytorch_qnnpack.h> #include <qnnpack_func.h> #include <cstring> namespace qnnpack { struct q8gemm_dq_context { size_t k; size_t k_stride; size_t n; size_t n_stride; const uint8_t* a; size_t a_stride; const uint8_t* packed_w; const float* bias; float* c; size_t c_stride; struct pytorch_q...
eaa96f7e06abe6274adeb5d2bec717bb2844fb99ea524c0e2ad19913f8ed04d6
C++
4,415
117
#include <ATen/MemoryOverlap.h> #include <ATen/core/TensorBase.h> #include <c10/util/irange.h> namespace at { MemOverlap has_internal_overlap(const TensorBase& tensor) { return has_internal_overlap(tensor.unsafeGetTensorImpl()); } MemOverlap has_internal_overlap(TensorImpl* t) { TORCH_INTERNAL_ASSERT_DEBUG_ONLY(...
fa6ace980c02354485789058df895d2ac808828f8e3a07c047a7e9830e2bbcd3
C++
4,416
121
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/core/Tensor.h> #include <c10/util/irange.h> #include <tuple> #include <utility> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #else #include <ATen/ops/conv_tbc_backward_native.h> #include <ATen/ops/conv_tbc_native...
8b3303e92b6eebb4e59f427e5bc516206b759f8ddbbc71dad17b9cafa2f31e21
C++
4,430
129
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/native/cuda/Sort.h> #include <ATen/core/Tensor.h> #include <ATen/ExpandUtils.h> #include <ATen/MemoryOverlap.h> #include <ATen/TensorUtils.h> #include <ATen/native/Sorting.h> #ifndef AT_PER_OPERATOR_HEADERS #include <ATen/Functions.h> #include <ATen/NativeFunct...