text1
stringlengths
0
536k
text2
stringlengths
0
536k
label
int64
0
1
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">Using the <a href="https://github.com/sindresorhus/npm-name"><code class="notranslate">npm-name</code> module</a> outputs <code class="notranslate">true</code> or <code class="notranslate">false</code> in a next project.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">Attempts to use <code class="notranslate">npm-name</code> result in the error:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="This dependency was not found: * electron in ./node_modules/npm-name/node_modules/got/index.js To install it, you can run: npm install --save electron"><pre class="notranslate">This dependency was not found: <span class="pl-k">*</span> electron <span class="pl-k">in</span> ./node_modules/npm-name/node_modules/got/index.js To install it, you can run: npm install --save electron</pre></div> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <p dir="auto">In a Next.JS project:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import npmName from 'npm-name' npmName('npm-name') // throws the error"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">npmName</span> <span class="pl-k">from</span> <span class="pl-s">'npm-name'</span> <span class="pl-en">npmName</span><span class="pl-kos">(</span><span class="pl-s">'npm-name'</span><span class="pl-kos">)</span> <span class="pl-c">// throws the error</span></pre></div> <h2 dir="auto">Context</h2> <p dir="auto">Trying to use the <code class="notranslate">npm-name</code> module results in Next throwing an error because electron is not installed. I don't want to introduce electron to the project obviously, and looking through the <a href="https://github.com/sindresorhus/got/blob/master/index.js#L90">source of <code class="notranslate">got</code></a>, I'm not sure why it's being required.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>next</td> <td>4.2.3</td> </tr> <tr> <td>node</td> <td>9.2.0</td> </tr> <tr> <td>OS</td> <td>macOS 10.12.6</td> </tr> <tr> <td>browser</td> <td>chrome63</td> </tr> </tbody> </table> <p dir="auto">Corresponding ticket with <code class="notranslate">npm-name</code>: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="294163753" data-permission-text="Title is private" data-url="https://github.com/sindresorhus/npm-name/issues/16" data-hovercard-type="issue" data-hovercard-url="/sindresorhus/npm-name/issues/16/hovercard" href="https://github.com/sindresorhus/npm-name/issues/16">sindresorhus/npm-name#16</a><br> I believe this is a NextJS issue.</p>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">Following the README.md instructions to run a next.js project, but create the project's folder in a subfolder which starts with a "."</p> <p dir="auto">Changing the text in index.js should initiate a recompile which is reflected in the browser.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">Next never recompiles after change are made to index.js. Must <code class="notranslate">ctrl+c</code> to quit, then run <code class="notranslate">npm run dev</code> again.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <p dir="auto">Please review video here: <a href="https://www.youtube.com/watch?v=HfOiCxw6bKw&amp;feature=youtu.be" rel="nofollow">https://www.youtube.com/watch?v=HfOiCxw6bKw&amp;feature=youtu.be</a><br> note that the project is running out a folder ".nosync" (because of this: <a href="https://discussions.apple.com/thread/6811420?start=0&amp;tstart=0" rel="nofollow">https://discussions.apple.com/thread/6811420?start=0&amp;tstart=0</a>)</p> <h2 dir="auto">Context</h2> <p dir="auto">Simply trying out next. basic HMR is not working correctly.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>next</td> <td>^4.1.3</td> </tr> <tr> <td>node</td> <td>8.7.0</td> </tr> <tr> <td>OS</td> <td>OSX 10.13</td> </tr> <tr> <td>browser</td> <td>Chrome 61</td> </tr> <tr> <td>etc</td> <td>npm 5.4.2</td> </tr> </tbody> </table>
0
<p dir="auto">Hello!<br> I have been working my way through the tf.contrib.learn <a href="https://www.tensorflow.org/tutorials/" rel="nofollow">tutorials</a> and have been attempting to integrate the tf.contrib.learn.monitors.ValidationMonitor into the 'deep' classifier in wide_n_deep.py as shown below.</p> <h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem? I searched both Github and Stakeoverflow with the terms 'tensorflow,' 'input_fn,' and 'validationmonitor' but wasn't able to find anyone else who reported similar issues.</h3> <h3 dir="auto">Environment info</h3> <p dir="auto">Operating System: I ran this on Ubuntu Server 16.04 on a physical I7 with a GTX1080 gpu when i noticed the problem. I know that i was using the GPU on the original physical box from previous tests, and because during the hang the nvidia_smi command showed considerable load on the GPU. I was able to replicate the problem with CPU on a 16.04 VM as well.</p> <p dir="auto">Installed version of CUDA and cuDNN:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/andersonjas/libcudnn5-dev_5.1.5-1+cuda8.0_amd64.deb /home/andersonjas/libcudnn5_5.1.5-1+cuda8.0_amd64.deb"><pre class="notranslate"><code class="notranslate">/home/andersonjas/libcudnn5-dev_5.1.5-1+cuda8.0_amd64.deb /home/andersonjas/libcudnn5_5.1.5-1+cuda8.0_amd64.deb </code></pre></div> <p dir="auto">If installed from binary pip package, provide:</p> <ol dir="auto"> <li>A link to the pip package you installed:<br> from Anaconda 2.7 64 bit package:</li> </ol> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="pip install tensorflow"><pre class="notranslate"><code class="notranslate">pip install tensorflow </code></pre></div> <ol start="2" dir="auto"> <li>The output from <code class="notranslate">python -c "import tensorflow; print(tensorflow.__version__)"</code>.</li> </ol> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="andersonjas@ubuntu:~$ python -c &quot;import tensorflow; print(tensorflow.__version__)&quot; I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally 0.11.head "><pre class="notranslate"><code class="notranslate">andersonjas@ubuntu:~$ python -c "import tensorflow; print(tensorflow.__version__)" I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally 0.11.head </code></pre></div> <p dir="auto">If installed from source, provide</p> <ol dir="auto"> <li>The commit hash (<code class="notranslate">git rev-parse HEAD</code>)</li> <li>The output of <code class="notranslate">bazel version</code></li> </ol> <h3 dir="auto">If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="validation_monitor = tf.contrib.learn.monitors.ValidationMonitor(input_fn=lambda:input_fn(df_test), every_n_steps=50) m.fit(input_fn=lambda: input_fn(df_train), steps=151,monitors=[validation_monitor])"><pre class="notranslate"><span class="pl-s1">validation_monitor</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">learn</span>.<span class="pl-s1">monitors</span>.<span class="pl-v">ValidationMonitor</span>(<span class="pl-s1">input_fn</span><span class="pl-c1">=</span><span class="pl-k">lambda</span>:<span class="pl-en">input_fn</span>(<span class="pl-s1">df_test</span>), <span class="pl-s1">every_n_steps</span><span class="pl-c1">=</span><span class="pl-c1">50</span>) <span class="pl-s1">m</span>.<span class="pl-en">fit</span>(<span class="pl-s1">input_fn</span><span class="pl-c1">=</span><span class="pl-k">lambda</span>: <span class="pl-en">input_fn</span>(<span class="pl-s1">df_train</span>), <span class="pl-s1">steps</span><span class="pl-c1">=</span><span class="pl-c1">151</span>,<span class="pl-s1">monitors</span><span class="pl-c1">=</span>[<span class="pl-s1">validation_monitor</span>])</pre></div> <p dir="auto">Doing this in a jupyter notebool causes the code to hang indefinitely. To make completely sure that i don't have a bug in my own code i can make the following change:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="validation_monitor = tf.contrib.learn.monitors.ValidationMonitor(input_fn=lambda:input_fn(df_test), every_n_steps=50) m.fit(input_fn=lambda: input_fn(df_train), steps=151) #,monitors=[validation_monitor])"><pre class="notranslate"><span class="pl-s1">validation_monitor</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">learn</span>.<span class="pl-s1">monitors</span>.<span class="pl-v">ValidationMonitor</span>(<span class="pl-s1">input_fn</span><span class="pl-c1">=</span><span class="pl-k">lambda</span>:<span class="pl-en">input_fn</span>(<span class="pl-s1">df_test</span>), <span class="pl-s1">every_n_steps</span><span class="pl-c1">=</span><span class="pl-c1">50</span>) <span class="pl-s1">m</span>.<span class="pl-en">fit</span>(<span class="pl-s1">input_fn</span><span class="pl-c1">=</span><span class="pl-k">lambda</span>: <span class="pl-en">input_fn</span>(<span class="pl-s1">df_train</span>), <span class="pl-s1">steps</span><span class="pl-c1">=</span><span class="pl-c1">151</span>) <span class="pl-c">#,monitors=[validation_monitor])</span></pre></div> <p dir="auto">and then the code executes fine.</p> <h3 dir="auto">What other attempted solutions have you tried?</h3> <p dir="auto">I also built an input_fn interface to the iris and boston housing price predictor code code, each showed similar 'hangs'</p> <h3 dir="auto">Logs or other output that would be helpful</h3> <p dir="auto">(If logs are large, please upload as attachment or provide link).</p> <p dir="auto">As a noob, i'm learning that esoteric error messages are a luxury :-), in this case the code just hangs indefinitely.</p>
<p dir="auto">hi all,</p> <p dir="auto">it would be really great to have a tutorial on how to use the many awesome wrappers like dropoutwrapper, attentionwrapper, etc.</p>
0
<p dir="auto">Hi guys, I hope this isnt't a really stupic question, but I'm unable to change the color (or even edit any less variable) in the getbootstrap/customize page.. I've tride in both Chrome and FF. Is this expected behavior?</p> <p dir="auto">Thanks,</p> <p dir="auto">John</p>
<p dir="auto">Just an idea.</p> <p dir="auto">Make it so that when you are about to enter text into the text boxes, rather than putting the cursor at the start and deleting the old content on type, you would instead mark it all when you enter a text box, and the user could then "unmark" a portion to merely edit the value slightly.</p> <p dir="auto">This is properly mostly useful for the "fonts" section, where you might not wan't to define your own complete set of font's but merely add or change a single of them and put that in higher priority.</p> <p dir="auto">Right now you have to retype all the font's, including the ones already there as defaults...</p> <p dir="auto">It's quite a minor thing, but it should also be a minor thing to fix I believe.</p> <p dir="auto">Cheers.</p>
1
<p dir="auto"><code class="notranslate">razzle.cmd</code> only checks Community and Enterprise paths of VS2017 to find <code class="notranslate">msbuild</code>.</p> <p dir="auto">Simply adding another two <code class="notranslate">if</code> blocks for checking <code class="notranslate">%ProgramFiles%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe</code> and <code class="notranslate">%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe</code> fixes the issue.</p>
<h1 dir="auto">Environment</h1> <p dir="auto">Windows build number:<br> powershell version<br> $psversiontable</p> <p dir="auto">PSVersion 5.1.18362.145<br> PSEdition Desktop<br> PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}<br> BuildVersion 10.0.18362.145<br> CLRVersion 4.0.30319.42000<br> WSManStackVersion 3.0<br> PSRemotingProtocolVersion 2.3<br> SerializationVersion 1.1.0.1</p> <p dir="auto">Windows Terminal version (if applicable): Windows Terminal (Preview) 0.4.2382.0</p> <p dir="auto">Any other software?<br> No</p> <h1 dir="auto">Steps to reproduce</h1> <ol dir="auto"> <li>Open two tabs in the terminal.</li> <li>In the first terminal, type "ubuntu" to go into WSL.</li> <li>cd it into a path with a long name.</li> </ol> <h1 dir="auto">Expected behavior</h1> <p dir="auto">Every tab name should be limited in a certain length or set adaptively.</p> <p dir="auto">It should be easy to switch among tabs and easy to close.</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">The tab name is too long but the terminal doesn't give it a length limit, and it strongly affects the function of following tabs.<br> There is no close button for the second tab.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/13214530/64932516-90fa2d80-d80d-11e9-8c0f-92c177e2187c.png"><img src="https://user-images.githubusercontent.com/13214530/64932516-90fa2d80-d80d-11e9-8c0f-92c177e2187c.png" alt="image" style="max-width: 100%;"></a></p>
0
<h2 dir="auto">Bug Report</h2> <p dir="auto">startup fail when using <code class="notranslate">mysql-connector-java 8.0.16</code></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'encryptDataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'encryptDataSource' threw exception; nested exception is java.lang.NumberFormatException: For input string: &quot;YES&quot; at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] ... 41 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'encryptDataSource' threw exception; nested exception is java.lang.NumberFormatException: For input string: &quot;YES&quot; at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] ... 54 common frames omitted Caused by: java.lang.NumberFormatException: For input string: &quot;YES&quot; at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) ~[na:1.8.0_171] at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[na:1.8.0_171] at java.lang.Double.parseDouble(Double.java:538) ~[na:1.8.0_171] at com.mysql.cj.protocol.a.MysqlTextValueDecoder.getDouble(MysqlTextValueDecoder.java:238) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.result.BooleanValueFactory.createFromBytes(BooleanValueFactory.java:113) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.result.BooleanValueFactory.createFromBytes(BooleanValueFactory.java:46) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeByteArray(MysqlTextValueDecoder.java:132) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:196) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:241) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:91) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.jdbc.result.ResultSetImpl.getBoolean(ResultSetImpl.java:678) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.jdbc.result.ResultSetImpl.getBoolean(ResultSetImpl.java:683) ~[mysql-connector-java-8.0.16.jar:8.0.16] at org.apache.commons.dbcp2.DelegatingResultSet.getBoolean(DelegatingResultSet.java:368) ~[commons-dbcp2-2.7.0.jar:2.7.0] at org.apache.commons.dbcp2.DelegatingResultSet.getBoolean(DelegatingResultSet.java:368) ~[commons-dbcp2-2.7.0.jar:2.7.0] at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.EncryptRuntimeContext.getColumnMetaDataList(EncryptRuntimeContext.java:95) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.EncryptRuntimeContext.createEncryptTableMetas(EncryptRuntimeContext.java:72) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.EncryptRuntimeContext.&lt;init&gt;(EncryptRuntimeContext.java:64) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.EncryptDataSource.&lt;init&gt;(EncryptDataSource.java:42) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.api.EncryptDataSourceFactory.createDataSource(EncryptDataSourceFactory.java:48) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration.encryptDataSource(SpringBootConfiguration.java:123) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$2b2b3348.CGLIB$encryptDataSource$1(&lt;generated&gt;) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$2b2b3348$$FastClassBySpringCGLIB$$842d7709.invoke(&lt;generated&gt;) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$2b2b3348.encryptDataSource(&lt;generated&gt;) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] ... 55 common frames omitted "><pre class="notranslate"><code class="notranslate">Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'encryptDataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'encryptDataSource' threw exception; nested exception is java.lang.NumberFormatException: For input string: "YES" at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] ... 41 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'encryptDataSource' threw exception; nested exception is java.lang.NumberFormatException: For input string: "YES" at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] ... 54 common frames omitted Caused by: java.lang.NumberFormatException: For input string: "YES" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) ~[na:1.8.0_171] at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[na:1.8.0_171] at java.lang.Double.parseDouble(Double.java:538) ~[na:1.8.0_171] at com.mysql.cj.protocol.a.MysqlTextValueDecoder.getDouble(MysqlTextValueDecoder.java:238) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.result.BooleanValueFactory.createFromBytes(BooleanValueFactory.java:113) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.result.BooleanValueFactory.createFromBytes(BooleanValueFactory.java:46) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeByteArray(MysqlTextValueDecoder.java:132) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:196) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:241) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.protocol.a.result.ByteArrayRow.getValue(ByteArrayRow.java:91) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.jdbc.result.ResultSetImpl.getBoolean(ResultSetImpl.java:678) ~[mysql-connector-java-8.0.16.jar:8.0.16] at com.mysql.cj.jdbc.result.ResultSetImpl.getBoolean(ResultSetImpl.java:683) ~[mysql-connector-java-8.0.16.jar:8.0.16] at org.apache.commons.dbcp2.DelegatingResultSet.getBoolean(DelegatingResultSet.java:368) ~[commons-dbcp2-2.7.0.jar:2.7.0] at org.apache.commons.dbcp2.DelegatingResultSet.getBoolean(DelegatingResultSet.java:368) ~[commons-dbcp2-2.7.0.jar:2.7.0] at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.EncryptRuntimeContext.getColumnMetaDataList(EncryptRuntimeContext.java:95) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.EncryptRuntimeContext.createEncryptTableMetas(EncryptRuntimeContext.java:72) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.EncryptRuntimeContext.&lt;init&gt;(EncryptRuntimeContext.java:64) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.EncryptDataSource.&lt;init&gt;(EncryptDataSource.java:42) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.api.EncryptDataSourceFactory.createDataSource(EncryptDataSourceFactory.java:48) ~[sharding-jdbc-core-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration.encryptDataSource(SpringBootConfiguration.java:123) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$2b2b3348.CGLIB$encryptDataSource$1(&lt;generated&gt;) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$2b2b3348$$FastClassBySpringCGLIB$$842d7709.invoke(&lt;generated&gt;) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE] at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$2b2b3348.encryptDataSource(&lt;generated&gt;) ~[sharding-jdbc-spring-boot-starter-4.0.0-RC3-SNAPSHOT.jar:4.0.0-RC3-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE] ... 55 common frames omitted </code></pre></div> <p dir="auto">Before report a bug, make sure you have:</p> <ul dir="auto"> <li>Searched open and closed <a href="https://github.com/apache/incubator-shardingsphere/issues">GitHub issues</a>.</li> <li>Read documentation: <a href="https://shardingsphere.apache.org/document/current/en/overview" rel="nofollow">ShardingSphere Doc</a>.</li> </ul> <p dir="auto">Please pay attention on issues you submitted, because we maybe need more details.<br> If no response <strong>more than 7 days</strong> and we cannot reproduce it on current information, we will <strong>close it</strong>.</p> <p dir="auto">Please answer these questions before submitting your issue. Thanks!</p> <h3 dir="auto">Which version of ShardingSphere did you use?</h3> <p dir="auto">4.0.0-RC3-SNAPSHOT</p> <h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3> <p dir="auto">Sharding-JDBC</p> <h3 dir="auto">Expected behavior</h3> <p dir="auto">startup successfully</p> <h3 dir="auto">Actual behavior</h3> <p dir="auto">startup fail</p> <h3 dir="auto">Reason analyze (If you can)</h3> <p dir="auto">different implementation on <code class="notranslate">resultSet.getBoolean</code><br> in mysql 5.1.40<br> com.mysql.jdbc.ResultSetImpl#getBooleanFromString</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" private final boolean getBooleanFromString(String stringVal) throws SQLException { if (stringVal != null &amp;&amp; stringVal.length() &gt; 0) { int c = Character.toLowerCase(stringVal.charAt(0)); return c == 't' || c == 'y' || c == '1' || stringVal.equals(&quot;-1&quot;); } else { return false; } }"><pre class="notranslate"><code class="notranslate"> private final boolean getBooleanFromString(String stringVal) throws SQLException { if (stringVal != null &amp;&amp; stringVal.length() &gt; 0) { int c = Character.toLowerCase(stringVal.charAt(0)); return c == 't' || c == 'y' || c == '1' || stringVal.equals("-1"); } else { return false; } } </code></pre></div> <p dir="auto">in mysql 8.0.16</p> <p dir="auto">com.mysql.cj.result.BooleanValueFactory#createFromBytes</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" @Override public Boolean createFromBytes(byte[] bytes, int offset, int length, Field f) { ... if (s.equalsIgnoreCase(&quot;Y&quot;) || s.equalsIgnoreCase(&quot;true&quot;)) { return createFromLong(1); } else if (s.equalsIgnoreCase(&quot;N&quot;) || s.equalsIgnoreCase(&quot;false&quot;)) { return createFromLong(0); } else if (s.contains(&quot;e&quot;) || s.contains(&quot;E&quot;) || s.matches(&quot;-?(\\d+)?\\.\\d+&quot;)) { // floating point return createFromDouble(MysqlTextValueDecoder.getDouble(newBytes, 0, newBytes.length)); } else if (s.matches(&quot;-?\\d+&quot;)) { // integer if (s.charAt(0) == '-' // TODO shouldn't we check the length as well? || length &lt;= (MysqlTextValueDecoder.MAX_SIGNED_LONG_LEN - 1) &amp;&amp; newBytes[0] &gt;= '0' &amp;&amp; newBytes[0] &lt;= '8') { return createFromLong(MysqlTextValueDecoder.getLong(newBytes, 0, newBytes.length)); } return createFromBigInteger(MysqlTextValueDecoder.getBigInteger(newBytes, 0, newBytes.length)); } throw new DataConversionException(Messages.getString(&quot;ResultSet.UnableToInterpretString&quot;, new Object[] { s })); }"><pre class="notranslate"><code class="notranslate"> @Override public Boolean createFromBytes(byte[] bytes, int offset, int length, Field f) { ... if (s.equalsIgnoreCase("Y") || s.equalsIgnoreCase("true")) { return createFromLong(1); } else if (s.equalsIgnoreCase("N") || s.equalsIgnoreCase("false")) { return createFromLong(0); } else if (s.contains("e") || s.contains("E") || s.matches("-?(\\d+)?\\.\\d+")) { // floating point return createFromDouble(MysqlTextValueDecoder.getDouble(newBytes, 0, newBytes.length)); } else if (s.matches("-?\\d+")) { // integer if (s.charAt(0) == '-' // TODO shouldn't we check the length as well? || length &lt;= (MysqlTextValueDecoder.MAX_SIGNED_LONG_LEN - 1) &amp;&amp; newBytes[0] &gt;= '0' &amp;&amp; newBytes[0] &lt;= '8') { return createFromLong(MysqlTextValueDecoder.getLong(newBytes, 0, newBytes.length)); } return createFromBigInteger(MysqlTextValueDecoder.getBigInteger(newBytes, 0, newBytes.length)); } throw new DataConversionException(Messages.getString("ResultSet.UnableToInterpretString", new Object[] { s })); } </code></pre></div> <h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3> <h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<h2 dir="auto">Bug Report</h2> <h3 dir="auto">Which version of Sharding-Sphere did you use?</h3> <p dir="auto">3.0.0</p> <h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3> <p dir="auto">Sharding-JDBC</p> <h3 dir="auto">Expected behavior</h3> <p dir="auto">SELECT<br> *<br> FROM<br> fin_material m<br> WHERE m.PROJ_ID = '10'<br> AND m.ID IN<br> (SELECT<br> c.MATERIAL_ID<br> FROM<br> fin_material_customer c<br> WHERE c.PROJ_ID = '10'<br> AND c.CUSTOMER_ID = '1');</p> <h3 dir="auto">Actual behavior</h3> <p dir="auto">Cause: io.shardingsphere.core.parsing.parser.exception.SQLParsingException: SQL syntax error, expected token is 'RIGHT_PAREN', actual token is 'IDENTIFIER', literals is 'c'.</p> <h3 dir="auto">Reason analyze (If you can)</h3> <p dir="auto">Subquery sub-database error</p> <h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3> <p dir="auto">SQL to execute</p> <h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
0
<p dir="auto">I know that there are na issues for indices but I have never encountered this behavior before (pandas master):<br> (fully functional code depending on the requests and xlrd library and a berlin open data set)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd import requests the_data = requests.get('http://www.berlin.de/imperia/md/content/senatsverwaltungen/finanzen/haushalt/ansatzn2013.xls?download.html', stream=True) xl_file = pd.io.parsers.ExcelFile(the_data.raw) # only works with xlrd installed df = xl_file.parse('Ansatz 2013') original_data = df.copy() df.columns = ['bereich', 'einzelplan', 'kapitel', 'titelart', 'titel', 'titelbezeichnung', 'funktion', 'betrag_tausend'] df['bereich_id'] = df.bereich.str.slice(start=1, stop=3).astype(int) df['bereich'] = df.bereich.str.slice(start=5) df['einzelplan_id'] = df.einzelplan.str.slice(start=1, stop=3).astype(int) df['einzelplan'] = df.einzelplan.str.slice(start=5) df['kapitel_id'] = df.kapitel.str.slice(start=1, stop=5).astype(int) df['kapitel'] = df.kapitel.str.slice(start=7) df['funktion_id'] = df.funktion.str.slice(start=1, stop=4).astype(float) # one missing value df['funktion'] = df.funktion.str.slice(start=6) df['betrag'] = df.betrag_tausend * 1000 del df['betrag_tausend'] df = df[['bereich', 'bereich_id', 'einzelplan', 'einzelplan_id', 'kapitel', 'kapitel_id', 'funktion', 'funktion_id', 'titel', 'titelbezeichnung', 'titelart', 'betrag']] df.set_index(['bereich', 'bereich_id', 'einzelplan', 'einzelplan_id', 'kapitel', 'kapitel_id', 'funktion', 'funktion_id', 'titel', 'titelbezeichnung', 'titelart'], inplace=True)"><pre class="notranslate"><code class="notranslate">import pandas as pd import requests the_data = requests.get('http://www.berlin.de/imperia/md/content/senatsverwaltungen/finanzen/haushalt/ansatzn2013.xls?download.html', stream=True) xl_file = pd.io.parsers.ExcelFile(the_data.raw) # only works with xlrd installed df = xl_file.parse('Ansatz 2013') original_data = df.copy() df.columns = ['bereich', 'einzelplan', 'kapitel', 'titelart', 'titel', 'titelbezeichnung', 'funktion', 'betrag_tausend'] df['bereich_id'] = df.bereich.str.slice(start=1, stop=3).astype(int) df['bereich'] = df.bereich.str.slice(start=5) df['einzelplan_id'] = df.einzelplan.str.slice(start=1, stop=3).astype(int) df['einzelplan'] = df.einzelplan.str.slice(start=5) df['kapitel_id'] = df.kapitel.str.slice(start=1, stop=5).astype(int) df['kapitel'] = df.kapitel.str.slice(start=7) df['funktion_id'] = df.funktion.str.slice(start=1, stop=4).astype(float) # one missing value df['funktion'] = df.funktion.str.slice(start=6) df['betrag'] = df.betrag_tausend * 1000 del df['betrag_tausend'] df = df[['bereich', 'bereich_id', 'einzelplan', 'einzelplan_id', 'kapitel', 'kapitel_id', 'funktion', 'funktion_id', 'titel', 'titelbezeichnung', 'titelart', 'betrag']] df.set_index(['bereich', 'bereich_id', 'einzelplan', 'einzelplan_id', 'kapitel', 'kapitel_id', 'funktion', 'funktion_id', 'titel', 'titelbezeichnung', 'titelart'], inplace=True) </code></pre></div> <p dir="auto">now calling</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df.groupby(level=['bereich']).sum()"><pre class="notranslate"><code class="notranslate">df.groupby(level=['bereich']).sum() </code></pre></div> <p dir="auto">works nicely whereas</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df.groupby(level=['funktion_id']).sum()"><pre class="notranslate"><code class="notranslate">df.groupby(level=['funktion_id']).sum() </code></pre></div> <p dir="auto">results in</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--------------------------------------------------------------------------- IndexError Traceback (most recent call last) &lt;ipython-input-3-d8991eeaebb9&gt; in &lt;module&gt;() ----&gt; 1 df.groupby(level=['funktion_id']).sum() /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/generic.pyc in groupby(self, by, axis, level, as_index, sort, group_keys) 132 from pandas.core.groupby import groupby 133 return groupby(self, by, axis=axis, level=level, as_index=as_index, --&gt; 134 sort=sort, group_keys=group_keys) 135 136 def asfreq(self, freq, method=None, how=None, normalize=False): /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in groupby(obj, by, **kwds) 498 raise TypeError('invalid type: %s' % type(obj)) 499 --&gt; 500 return klass(obj, by, **kwds) 501 502 /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in __init__(self, obj, keys, axis, level, grouper, exclusions, selection, as_index, sort, group_keys) 189 if grouper is None: 190 grouper, exclusions = _get_grouper(obj, keys, axis=axis, --&gt; 191 level=level, sort=sort) 192 193 self.grouper = grouper /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in _get_grouper(obj, key, axis, level, sort) 1244 name = gpr 1245 gpr = obj[gpr] -&gt; 1246 ping = Grouping(group_axis, gpr, name=name, level=level, sort=sort) 1247 groupings.append(ping) 1248 /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in __init__(self, index, grouper, name, level, sort) 1115 self._labels = labels 1116 self._group_index = level_index -&gt; 1117 self.grouper = level_index.take(labels) 1118 else: 1119 if isinstance(self.grouper, (list, tuple)): /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/index.pyc in take(self, indexer, axis) 415 &quot;&quot;&quot; 416 indexer = com._ensure_platform_int(indexer) --&gt; 417 taken = self.view(np.ndarray).take(indexer) 418 return self._constructor(taken, name=self.name) 419 IndexError: index 138 is out of bounds for axis 0 with size 138"><pre class="notranslate"><code class="notranslate">--------------------------------------------------------------------------- IndexError Traceback (most recent call last) &lt;ipython-input-3-d8991eeaebb9&gt; in &lt;module&gt;() ----&gt; 1 df.groupby(level=['funktion_id']).sum() /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/generic.pyc in groupby(self, by, axis, level, as_index, sort, group_keys) 132 from pandas.core.groupby import groupby 133 return groupby(self, by, axis=axis, level=level, as_index=as_index, --&gt; 134 sort=sort, group_keys=group_keys) 135 136 def asfreq(self, freq, method=None, how=None, normalize=False): /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in groupby(obj, by, **kwds) 498 raise TypeError('invalid type: %s' % type(obj)) 499 --&gt; 500 return klass(obj, by, **kwds) 501 502 /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in __init__(self, obj, keys, axis, level, grouper, exclusions, selection, as_index, sort, group_keys) 189 if grouper is None: 190 grouper, exclusions = _get_grouper(obj, keys, axis=axis, --&gt; 191 level=level, sort=sort) 192 193 self.grouper = grouper /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in _get_grouper(obj, key, axis, level, sort) 1244 name = gpr 1245 gpr = obj[gpr] -&gt; 1246 ping = Grouping(group_axis, gpr, name=name, level=level, sort=sort) 1247 groupings.append(ping) 1248 /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/groupby.pyc in __init__(self, index, grouper, name, level, sort) 1115 self._labels = labels 1116 self._group_index = level_index -&gt; 1117 self.grouper = level_index.take(labels) 1118 else: 1119 if isinstance(self.grouper, (list, tuple)): /usr/local/lib/python2.7/dist-packages/pandas-0.10.1.dev_dcd9df7-py2.7-linux-x86_64.egg/pandas/core/index.pyc in take(self, indexer, axis) 415 """ 416 indexer = com._ensure_platform_int(indexer) --&gt; 417 taken = self.view(np.ndarray).take(indexer) 418 return self._constructor(taken, name=self.name) 419 IndexError: index 138 is out of bounds for axis 0 with size 138 </code></pre></div> <p dir="auto">and</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="df.groupby(level=['funktion']).sum()"><pre class="notranslate"><code class="notranslate">df.groupby(level=['funktion']).sum() </code></pre></div> <p dir="auto">segfaults</p>
<p dir="auto">The <code class="notranslate">ExcelWriter</code> class in line 550 of <a href="https://github.com/pydata/pandas/blob/6c692aee6d411d67997c4fadd023a1d4b7f91c12/pandas/io/excel.py#L550">pandas/pandas/io/excel.py</a> takes a <code class="notranslate">datetime_format</code> parameter to format a datetime column.</p> <p dir="auto">Wouldn't it be useful to include a <code class="notranslate">font_size</code> parameter as well? Otherwise I don't see how I can set the font size apart from the hard way through <code class="notranslate">xlsxwriter</code>. Correct me if I am wrong.</p>
0
<p dir="auto">[root@irlab julia]# make<br> LINK uijulia-release-readline<br> /usr/bin/ld: cannot find -lncurses<br> collect2: ld 返回 1<br> make[1]: *** [/home/huangshaomang/soft/julia/julia-release-readline] 错误 1<br> make: *** [julia-release] 错误 2<br> [root@irlab julia]#</p> <p dir="auto">what's up? please help me..</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CC src/jltypes.o CC src/gf.o CC src/support/hashing.o CC src/support/timefuncs.o CC src/support/dblprint.o CC src/support/ptrhash.o CC src/support/operators.o CC src/support/socket.o CC src/support/utf8.o CC src/support/ios.o CC src/support/dirpath.o CC src/support/htable.o CC src/support/bitvector.o CC src/support/int2str.o CC src/support/dump.o CC src/support/libsupportinit.o CC src/support/arraylist.o LINK src/support/libsupport.a CC src/flisp/flisp.o CC src/flisp/builtins.o CC src/flisp/string.o CC src/flisp/equalhash.o CC src/flisp/table.o CC src/flisp/iostream.o CC src/flisp/julia_extensions.o LINK src/flisp/libflisp.a CC src/flisp/flmain.o CC src/flisp/flisp FLISP src/julia_flisp.boot FLISP src/julia_flisp.boot.inc CC src/ast.o CC src/builtins.o CC src/module.o CC src/codegen.o CC src/interpreter.o CC src/alloc.o CC src/dlload.o CC src/sys.o CC src/init.o CC src/task.o CC src/array.o CC src/dump.o CC src/gc.o LINK src/libjulia-release.a LINK libjulia-release.so CC ui/repl.o CC ui/repl-basic.o LINK uijulia-release-basic CC ui/repl-readline.o LINK uijulia-release-readline LINK ui/webserverjulia-release-webserver PERL j/pcre_h.j PERL j/errno_h.j JULIA sys0.ji"><pre class="notranslate"><code class="notranslate">CC src/jltypes.o CC src/gf.o CC src/support/hashing.o CC src/support/timefuncs.o CC src/support/dblprint.o CC src/support/ptrhash.o CC src/support/operators.o CC src/support/socket.o CC src/support/utf8.o CC src/support/ios.o CC src/support/dirpath.o CC src/support/htable.o CC src/support/bitvector.o CC src/support/int2str.o CC src/support/dump.o CC src/support/libsupportinit.o CC src/support/arraylist.o LINK src/support/libsupport.a CC src/flisp/flisp.o CC src/flisp/builtins.o CC src/flisp/string.o CC src/flisp/equalhash.o CC src/flisp/table.o CC src/flisp/iostream.o CC src/flisp/julia_extensions.o LINK src/flisp/libflisp.a CC src/flisp/flmain.o CC src/flisp/flisp FLISP src/julia_flisp.boot FLISP src/julia_flisp.boot.inc CC src/ast.o CC src/builtins.o CC src/module.o CC src/codegen.o CC src/interpreter.o CC src/alloc.o CC src/dlload.o CC src/sys.o CC src/init.o CC src/task.o CC src/array.o CC src/dump.o CC src/gc.o LINK src/libjulia-release.a LINK libjulia-release.so CC ui/repl.o CC ui/repl-basic.o LINK uijulia-release-basic CC ui/repl-readline.o LINK uijulia-release-readline LINK ui/webserverjulia-release-webserver PERL j/pcre_h.j PERL j/errno_h.j JULIA sys0.ji </code></pre></div> <p dir="auto">make: *** [sys0.ji] Error 1</p>
1
<h3 dir="auto">Description</h3> <p dir="auto">dag import fails sometimes due to some changes in sys config, ignored rare case scenario.<br> Need an alert on slack/mail whenever dag import fails.</p> <h3 dir="auto">Use case/motivation</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Related issues</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Are you willing to submit a PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li> </ul> <h3 dir="auto">Code of Conduct</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li> </ul>
<h3 dir="auto">Description</h3> <p dir="auto">It would be great to be able to grant permission for each connection with the Airflow permission value.</p> <p dir="auto">Currently, there are ​​"an create on Connections, can read on Connections, can edit on Connections, can delete on Connections and menu access on Connections".</p> <p dir="auto">I think we need "can access on Connection:CONNECTION_NAME, can read on Connection:CONNECTION_NAME, can edit on Connection:CONNECTION_NAME, can delete on Connection:CONNECTION_NAME" as well.</p> <h3 dir="auto">Use case/motivation</h3> <p dir="auto">When multiple people use airflow, there needs to limit the connections each user can access.</p> <h3 dir="auto">Related issues</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Are you willing to submit a PR?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li> </ul> <h3 dir="auto">Code of Conduct</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li> </ul>
0
<p dir="auto">I'm running into this error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./request.rs:1:7: 1:29 error: duplicate definition of type request ./request.rs:1 import mre::request::request; ^~~~~~~~~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">./request.rs:1:7: 1:29 error: duplicate definition of type request ./request.rs:1 import mre::request::request; ^~~~~~~~~~~~~~~~~~~~~~ </code></pre></div> <p dir="auto">even though I only import <code class="notranslate">mre::request::request</code> once in that file. Perhaps I'm running into a compiler bug, or maybe I just don't quite understand the import rules. So, it would be helpful if the duplicate definition error also reported where rust first found the definition.</p>
<p dir="auto">This code:</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="static TEST: int = 10; static TEST2: &amp;'static int = &amp;TEST;"><pre class="notranslate"><span class="pl-k">static</span> <span class="pl-v">TEST</span><span class="pl-kos">:</span> <span class="pl-smi">int</span> = <span class="pl-c1">10</span><span class="pl-kos">;</span> <span class="pl-k">static</span> <span class="pl-v">TEST2</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-c1">'</span><span class="pl-ent">static</span> <span class="pl-smi">int</span> = <span class="pl-c1">&amp;</span><span class="pl-v">TEST</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Produces the following IR:</p> <div class="highlight highlight-source-llvm notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@_ZN4TEST20h60213af30ae88ef1eaaE = internal constant i64 10 @const = private constant i64 10 @_ZN5TEST220hc4be0dea553bf116iaaE = internal constant i64* @const"><pre class="notranslate"><span class="pl-c1">@_ZN4TEST20h60213af30ae88ef1eaaE</span> = <span class="pl-k">internal</span> <span class="pl-k">constant</span> <span class="pl-k">i64</span> <span class="pl-c1">10</span> <span class="pl-c1">@const</span> = <span class="pl-k">private</span> <span class="pl-k">constant</span> <span class="pl-k">i64</span> <span class="pl-c1">10</span> <span class="pl-c1">@_ZN5TEST220hc4be0dea553bf116iaaE</span> = <span class="pl-k">internal</span> <span class="pl-k">constant</span> <span class="pl-k">i64*</span> <span class="pl-c1">@const</span></pre></div> <p dir="auto">So <code class="notranslate">TEST2</code> points to a duplicate of <code class="notranslate">TEST</code>, namely <code class="notranslate">@const</code>, rather than <code class="notranslate">TEST</code> itself.</p>
0
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I tried using the <code class="notranslate">@types/angular-xeditable</code> package and had problems. <ul dir="auto"> <li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/andy-ms/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/andy-ms">@andy-ms</a></li> </ul> </li> </ul> <p dir="auto">I am getting the error - duplicate identifier for 'angular' module. I have modified the xeditable's typing file, then its working fine. I would raise a pull request. Please review it.</p> <p dir="auto">modified type definition is as follows</p> <p dir="auto">`// Generated by typings<br> // Source: <a href="https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/1770103b6ef1a658476712c1f127e41dc2c8aca1/angular-xeditable/index.d.ts" rel="nofollow">https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/1770103b6ef1a658476712c1f127e41dc2c8aca1/angular-xeditable/index.d.ts</a></p> <p dir="auto">declare module "xeditable" {<br> // Type definitions for Angular xEditable (angular.xeditable module) 0.2<br> // Project: <a href="https://vitalets.github.io/angular-xeditable/" rel="nofollow">https://vitalets.github.io/angular-xeditable/</a><br> // Definitions by: Joao Monteiro <a href="https://github.com/jpmnteiro">https://github.com/jpmnteiro</a><br> // Definitions: <a href="https://github.com/DefinitelyTyped/DefinitelyTyped">https://github.com/DefinitelyTyped/DefinitelyTyped</a><br> import xeditable = angular.xeditable;<br> export = xeditable;<br> }</p> <p dir="auto">declare namespace angular.xeditable {<br> interface IEditableOptions {</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" /** * Theme. Possible values `bs3`, `bs2`, `default` */ theme: string; /** * Icon Set. Possible values `font-awesome`, `default`. */ icon_set: string; /** * Whether to show buttons for single editalbe element. * Possible values `right` (default), `no`. */ buttons: string; /** * Default value for `blur` attribute of single editable element. * Can be `cancel|submit|ignore`. */ blurElem: string; /** * Default value for `blur` attribute of editable form. * Can be `cancel|submit|ignore`. */ blurForm: string; /** * How input elements get activated. Possible values: `focus|select|none`. */ activate: string; /** * Whether to disable x-editable. Can be overloaded on each element. */ isDisabled: boolean; /* * Event, on which the edit mode gets activated. * Can be any event. */ activationEvent: string; } interface IEditableFormController extends angular.IFormController { /** * Shows form with editable controls. */ $show(): void; /** * Hides form with editable controls without saving. */ $hide(): void; /** * Sets focus on form field specified by `name`.&lt;br/&gt; * When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called. * * @param name name of field */ $activate(name: string): void; /** * Triggers `oncancel` event and calls `$hide()`. */ $cancel(): void; $setWaiting(value: boolean): void; /** * Shows error message for particular field. * * @param name name of field * @param msg error message */ $setError(name: string, msg: string): void; $submit(): void; $save(): void; }"><pre class="notranslate"><code class="notranslate"> /** * Theme. Possible values `bs3`, `bs2`, `default` */ theme: string; /** * Icon Set. Possible values `font-awesome`, `default`. */ icon_set: string; /** * Whether to show buttons for single editalbe element. * Possible values `right` (default), `no`. */ buttons: string; /** * Default value for `blur` attribute of single editable element. * Can be `cancel|submit|ignore`. */ blurElem: string; /** * Default value for `blur` attribute of editable form. * Can be `cancel|submit|ignore`. */ blurForm: string; /** * How input elements get activated. Possible values: `focus|select|none`. */ activate: string; /** * Whether to disable x-editable. Can be overloaded on each element. */ isDisabled: boolean; /* * Event, on which the edit mode gets activated. * Can be any event. */ activationEvent: string; } interface IEditableFormController extends angular.IFormController { /** * Shows form with editable controls. */ $show(): void; /** * Hides form with editable controls without saving. */ $hide(): void; /** * Sets focus on form field specified by `name`.&lt;br/&gt; * When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called. * * @param name name of field */ $activate(name: string): void; /** * Triggers `oncancel` event and calls `$hide()`. */ $cancel(): void; $setWaiting(value: boolean): void; /** * Shows error message for particular field. * * @param name name of field * @param msg error message */ $setError(name: string, msg: string): void; $submit(): void; $save(): void; } </code></pre></div> <p dir="auto">}<br> `</p> <p dir="auto">Thanks,<br> Viresh</p>
<p dir="auto">If you know how to fix the issue, make a pull request instead.</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/xxxx</code> package and had problems.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>. (Please ask any appropriate questions there).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond. <ul dir="auto"> <li>Authors: @.types/node 10.0</li> </ul> </li> </ul> <p dir="auto">With v9.6.6 everything was fine with my Angular project. Upgraded to 10.0.0 and now I get the following errors running my unit tests:</p> <p dir="auto"><code class="notranslate">Error: node_modules/@types/node/index.d.ts(2381,15): error TS2300: Duplicate identifier 'URL'. node_modules/@types/node/index.d.ts(2399,15): error TS2300: Duplicate identifier 'URLSearchParams'. node_modules/@types/node/index.d.ts(2417,14): error TS2661: Cannot export 'URL'. Only local declarations can be exported from a module. node_modules/@types/node/index.d.ts(2417,19): error TS2661: Cannot export 'URLSearchParams'. Only local declarations can be exported from a module. node_modules/typescript/lib/lib.dom.d.ts(12210,11): error TS2300: Duplicate identifier 'URL'. node_modules/typescript/lib/lib.dom.d.ts(12226,13): error TS2300: Duplicate identifier 'URL'. node_modules/typescript/lib/lib.dom.d.ts(14282,11): error TS2300: Duplicate identifier 'URLSearchParams'. node_modules/typescript/lib/lib.dom.d.ts(14309,13): error TS2300: Duplicate identifier 'URLSearchParams'.</code></p>
0
<p dir="auto">Currently, there are two formulations in the documentation: (1) in the <code class="notranslate">Returns</code> description, some form of "N trials given n successes" where the last trial is incorrectly indexed as N + n and (2) in the <code class="notranslate">Notes</code>, "N failures given n successes and p(success) = p". <del>However, neither of these descriptions match the variable that is actually returned, which via the gamma-Poisson mixture is "N successes given n failures and p(success) = p".</del> While "N failures given n successes" and "N successes given n failures" have the same expression as their respective pmfs, they are not equivalent except when p=0.5:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np import scipy as sp import scipy.special N = np.arange(100) p = 0.5 # N successes given 5 failures p0 = sp.special.binom(N + 5 - 1, N) * p**N *(1-p)**5 # N failures given 5 succeses p1 = sp.special.binom(5 + N - 1, 4) * p**5 *(1-p)**N np.allclose(p0 ,p1) # True p = 0.75 p0 = sp.special.binom(N + 5 - 1, N) * p**N *(1-p)**5 p1 = sp.special.binom(5 + N - 1, 4) * p**5 *(1-p)**N np.allclose(p0, p1) # False"><pre class="notranslate"><code class="notranslate">import numpy as np import scipy as sp import scipy.special N = np.arange(100) p = 0.5 # N successes given 5 failures p0 = sp.special.binom(N + 5 - 1, N) * p**N *(1-p)**5 # N failures given 5 succeses p1 = sp.special.binom(5 + N - 1, 4) * p**5 *(1-p)**N np.allclose(p0 ,p1) # True p = 0.75 p0 = sp.special.binom(N + 5 - 1, N) * p**N *(1-p)**5 p1 = sp.special.binom(5 + N - 1, 4) * p**5 *(1-p)**N np.allclose(p0, p1) # False </code></pre></div> <p dir="auto">Clearly "N failures given n successes and p(success) = p" is equivalent to "N successes given n failures and p(success) = 1 - p". <del>The quickest solution is to change the description to match "N successes given n failures and p(success) = p".</del> I also suggest switching to the p(k; r, p) notation used on the negative binomial distribution Wikipedia page.</p> <p dir="auto">EDIT: On further inspection, the output does match the second description, given the shape and scale parameterization of the gamma distribution. I've changed the title to reflect this.</p>
<p dir="auto">The docstring says that negative_binomial() returns:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="out : ndarray or scalar Drawn samples from the parameterized negative binomial distribution, where each sample is equal to N, the number of trials it took to achieve n - 1 successes, N - (n - 1) failures, and a success on the, (N + n)th trial."><pre class="notranslate"><code class="notranslate">out : ndarray or scalar Drawn samples from the parameterized negative binomial distribution, where each sample is equal to N, the number of trials it took to achieve n - 1 successes, N - (n - 1) failures, and a success on the, (N + n)th trial. </code></pre></div> <p dir="auto">N isn't the number of trials, it's the number of failures. The number of trials (excluding "the (N+n)th trial") is N+n-1, as in the equation in the "Notes" section. The formula N - (n - 1) is wrong too, it should be just N.</p> <p dir="auto">If the drawn sample were the number of trials, the minimum returned value would be n-1, but it plainly is not:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import numpy as np &gt;&gt;&gt; np.random.negative_binomial(10, .99) 0 &gt;&gt;&gt;"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">negative_binomial</span>(<span class="pl-c1">10</span>, <span class="pl-c1">.99</span>) <span class="pl-c1">0</span> <span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span></pre></div>
1
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gcs-github/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gcs-github">@gcs-github</a> on 2016-11-24T20:14:54Z</p> <h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">zfs</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0 </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="hash_behavior = merge force_handlers = True pipelining = True control_path = %(directory)s/%%p-%%h-%%r"><pre class="notranslate"><code class="notranslate">hash_behavior = merge force_handlers = True pipelining = True control_path = %(directory)s/%%p-%%h-%%r </code></pre></div> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">Managing from macOS 10.12<br> Managing Gentoo Linux hosts</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">Currently, the ZFS module will only consider <code class="notranslate">local</code> settings while comparing the current state of a ZFS filesystem and its intended target state. This can lead to unwanted <code class="notranslate">set</code> operations to occur even when the target filesystem is in the state described in the play, hurting idempotence.</p> <p dir="auto">A good example of this is with the "mountpoint" property. If ZFS dataset <code class="notranslate">B</code> exists as a child of dataset <code class="notranslate">A</code>, but dataset <code class="notranslate">A</code> was previously restored from a backup with <code class="notranslate">zfs receive</code>, therefore having most of its properties not flagged as <code class="notranslate">local</code>, but as <code class="notranslate">received</code> instead (including <code class="notranslate">mountpoint</code>), a run of the ZFS module on <code class="notranslate">A</code> will attempt to first unmount <code class="notranslate">B</code> so that it can perform a <code class="notranslate">mountpoint</code> property change on <code class="notranslate">A</code> even though <code class="notranslate">A</code> already has its <code class="notranslate">mountpoint</code> property set to the correct value.</p> <p dir="auto">In some cases the above will fail (for example if a file is open in dataset <code class="notranslate">B</code> so that <code class="notranslate">B</code> can't be unmounted), but in other cases this will still yield an unwanted side effect where an unmount will be forced to occur even when it shouldn't.</p> <p dir="auto">I'm not sure why only <code class="notranslate">local</code> properties are being considered at present when comparing current dataset state and target dataset state. Unless I'm missing something, I believe a valid fix could be to simply delete the following line: <a href="https://github.com/ansible/ansible-modules-extras/blob/9760ec2538f8b44cb7f27924617a8e024a694724/system/zfs.py#L198">https://github.com/ansible/ansible-modules-extras/blob/9760ec2538f8b44cb7f27924617a8e024a694724/system/zfs.py#L198</a></p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <ol dir="auto"> <li><code class="notranslate">zfs receive</code> any dataset containing children in place of one normally managed by an ansible play</li> <li>run something on the server making use of a file in the one of the children datasets and keeping it open</li> <li>run the play containing the zfs module call that tries to ensure zfs dataset properties are set correctly</li> </ol> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">no <code class="notranslate">zfs set</code> command should be issued for dataset properties which are already set to the correct value</p> <h5 dir="auto">ACTUAL RESULTS</h5> <p dir="auto"><code class="notranslate">zfs set</code> commands are issued on the managed host to set properties to a value they are already set at, in some cases causing unwanted side effects on the managed dataset and its children.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Using module file /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/modules/extras/system/zfs.py &lt;xxx.yyy.zzz&gt; ESTABLISH SSH CONNECTION FOR USER: root &lt;xxx.yyy.zzz&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/guillaume/.ansible/cp/%p-%h-%r xxx.yyy.zzz '/bin/sh -c '&quot;'&quot;'/usr/bin/python2 &amp;&amp; sleep 0'&quot;'&quot;'' fatal: [xxx.yyy.zzz]: FAILED! =&gt; { &quot;changed&quot;: false, &quot;failed&quot;: true, &quot;invocation&quot;: { &quot;module_args&quot;: { &quot;atime&quot;: &quot;off&quot;, &quot;canmount&quot;: &quot;on&quot;, &quot;casesensitivity&quot;: &quot;sensitive&quot;, &quot;checksum&quot;: &quot;fletcher4&quot;, &quot;compression&quot;: &quot;lz4&quot;, &quot;copies&quot;: &quot;1&quot;, &quot;createparent&quot;: null, &quot;devices&quot;: &quot;off&quot;, &quot;exec&quot;: &quot;off&quot;, &quot;logbias&quot;: &quot;latency&quot;, &quot;mountpoint&quot;: &quot;/var/lib/mysql&quot;, &quot;nbmand&quot;: &quot;off&quot;, &quot;normalization&quot;: &quot;formD&quot;, &quot;primarycache&quot;: &quot;metadata&quot;, &quot;quota&quot;: &quot;none&quot;, &quot;readonly&quot;: &quot;off&quot;, &quot;recordsize&quot;: &quot;16K&quot;, &quot;refquota&quot;: &quot;none&quot;, &quot;refreservation&quot;: &quot;none&quot;, &quot;reservation&quot;: &quot;none&quot;, &quot;secondarycache&quot;: &quot;none&quot;, &quot;setuid&quot;: &quot;off&quot;, &quot;sharenfs&quot;: &quot;off&quot;, &quot;sharesmb&quot;: &quot;off&quot;, &quot;snapdir&quot;: &quot;hidden&quot;, &quot;utf8only&quot;: &quot;on&quot;, &quot;xattr&quot;: &quot;off&quot; }, &quot;module_name&quot;: &quot;zfs&quot; }, &quot;msg&quot;: &quot;umount: /var/lib/mysql/relay_log: target is busy\n (In some cases useful info about processes that\n use the device is found by lsof(8) or fuser(1).)\ncannot unmount '/var/lib/mysql/relay_log': umount failed\n&quot; }"><pre class="notranslate"><code class="notranslate">Using module file /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/modules/extras/system/zfs.py &lt;xxx.yyy.zzz&gt; ESTABLISH SSH CONNECTION FOR USER: root &lt;xxx.yyy.zzz&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/guillaume/.ansible/cp/%p-%h-%r xxx.yyy.zzz '/bin/sh -c '"'"'/usr/bin/python2 &amp;&amp; sleep 0'"'"'' fatal: [xxx.yyy.zzz]: FAILED! =&gt; { "changed": false, "failed": true, "invocation": { "module_args": { "atime": "off", "canmount": "on", "casesensitivity": "sensitive", "checksum": "fletcher4", "compression": "lz4", "copies": "1", "createparent": null, "devices": "off", "exec": "off", "logbias": "latency", "mountpoint": "/var/lib/mysql", "nbmand": "off", "normalization": "formD", "primarycache": "metadata", "quota": "none", "readonly": "off", "recordsize": "16K", "refquota": "none", "refreservation": "none", "reservation": "none", "secondarycache": "none", "setuid": "off", "sharenfs": "off", "sharesmb": "off", "snapdir": "hidden", "utf8only": "on", "xattr": "off" }, "module_name": "zfs" }, "msg": "umount: /var/lib/mysql/relay_log: target is busy\n (In some cases useful info about processes that\n use the device is found by lsof(8) or fuser(1).)\ncannot unmount '/var/lib/mysql/relay_log': umount failed\n" } </code></pre></div> <p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="191586395" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/3543" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/3543/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/3543">ansible/ansible-modules-extras#3543</a></p>
<h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">module system/zfs</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0 </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="hash_behavior = merge force_handlers = True pipelining = True control_path = %(directory)s/%%p-%%h-%%r"><pre class="notranslate"><code class="notranslate">hash_behavior = merge force_handlers = True pipelining = True control_path = %(directory)s/%%p-%%h-%%r </code></pre></div> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">Managing from macOS 10.12<br> Managing Gentoo Linux hosts</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto"><em>(this issue was ported over from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="191586395" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-extras/issues/3543" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-extras/issues/3543/hovercard" href="https://github.com/ansible/ansible-modules-extras/issues/3543">ansible/ansible-modules-extras#3543</a> following the repository merge of ansible/ansible-modules-extras into ansible/ansible)</em></p> <p dir="auto">Currently, the ZFS module will only consider <code class="notranslate">local</code> settings while comparing the current state of a ZFS filesystem and its intended target state. This can lead to unwanted <code class="notranslate">set</code> operations to occur even when the target filesystem is in the state described in the play, hurting idempotence.</p> <p dir="auto">A good example of this is with the "mountpoint" property. If ZFS dataset <code class="notranslate">B</code> exists as a child of dataset <code class="notranslate">A</code>, but dataset <code class="notranslate">A</code> was previously restored from a backup with <code class="notranslate">zfs receive</code>, therefore having most of its properties not flagged as <code class="notranslate">local</code>, but as <code class="notranslate">received</code> instead (including <code class="notranslate">mountpoint</code>), a run of the ZFS module on <code class="notranslate">A</code> will attempt to first unmount <code class="notranslate">B</code> so that it can perform a <code class="notranslate">mountpoint</code> property change on <code class="notranslate">A</code> even though <code class="notranslate">A</code> already has its <code class="notranslate">mountpoint</code> property set to the correct value.</p> <p dir="auto">In some cases the above will fail (for example if a file is open in dataset <code class="notranslate">B</code> so that <code class="notranslate">B</code> can't be unmounted), but in other cases this will still yield an unwanted side effect where an unmount will be forced to occur even when it shouldn't.</p> <p dir="auto">I'm not sure why only <code class="notranslate">local</code> properties are being considered at present when comparing current dataset state and target dataset state. Unless I'm missing something, I believe a valid fix could be to simply delete the following line: <a href="https://github.com/ansible/ansible-modules-extras/blob/9760ec2538f8b44cb7f27924617a8e024a694724/system/zfs.py#L198">https://github.com/ansible/ansible-modules-extras/blob/9760ec2538f8b44cb7f27924617a8e024a694724/system/zfs.py#L198</a></p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <ol dir="auto"> <li><code class="notranslate">zfs receive</code> any dataset containing children in place of one normally managed by an ansible play</li> <li>run something on the server making use of a file in the one of the children datasets and keeping it open</li> <li>run the play containing the zfs module call that tries to ensure zfs dataset properties are set correctly</li> </ol> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">no <code class="notranslate">zfs set</code> command should be issued for dataset properties which are already set to the correct value</p> <h5 dir="auto">ACTUAL RESULTS</h5> <p dir="auto"><code class="notranslate">zfs set</code> commands are issued on the managed host to set properties to a value they are already set at, in some cases causing unwanted side effects on the managed dataset and its children.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Using module file /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/modules/extras/system/zfs.py &lt;xxx.yyy.zzz&gt; ESTABLISH SSH CONNECTION FOR USER: root &lt;xxx.yyy.zzz&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/guillaume/.ansible/cp/%p-%h-%r xxx.yyy.zzz '/bin/sh -c '&quot;'&quot;'/usr/bin/python2 &amp;&amp; sleep 0'&quot;'&quot;'' fatal: [xxx.yyy.zzz]: FAILED! =&gt; { &quot;changed&quot;: false, &quot;failed&quot;: true, &quot;invocation&quot;: { &quot;module_args&quot;: { &quot;atime&quot;: &quot;off&quot;, &quot;canmount&quot;: &quot;on&quot;, &quot;casesensitivity&quot;: &quot;sensitive&quot;, &quot;checksum&quot;: &quot;fletcher4&quot;, &quot;compression&quot;: &quot;lz4&quot;, &quot;copies&quot;: &quot;1&quot;, &quot;createparent&quot;: null, &quot;devices&quot;: &quot;off&quot;, &quot;exec&quot;: &quot;off&quot;, &quot;logbias&quot;: &quot;latency&quot;, &quot;mountpoint&quot;: &quot;/var/lib/mysql&quot;, &quot;nbmand&quot;: &quot;off&quot;, &quot;normalization&quot;: &quot;formD&quot;, &quot;primarycache&quot;: &quot;metadata&quot;, &quot;quota&quot;: &quot;none&quot;, &quot;readonly&quot;: &quot;off&quot;, &quot;recordsize&quot;: &quot;16K&quot;, &quot;refquota&quot;: &quot;none&quot;, &quot;refreservation&quot;: &quot;none&quot;, &quot;reservation&quot;: &quot;none&quot;, &quot;secondarycache&quot;: &quot;none&quot;, &quot;setuid&quot;: &quot;off&quot;, &quot;sharenfs&quot;: &quot;off&quot;, &quot;sharesmb&quot;: &quot;off&quot;, &quot;snapdir&quot;: &quot;hidden&quot;, &quot;utf8only&quot;: &quot;on&quot;, &quot;xattr&quot;: &quot;off&quot; }, &quot;module_name&quot;: &quot;zfs&quot; }, &quot;msg&quot;: &quot;umount: /var/lib/mysql/relay_log: target is busy\n (In some cases useful info about processes that\n use the device is found by lsof(8) or fuser(1).)\ncannot unmount '/var/lib/mysql/relay_log': umount failed\n&quot; }"><pre class="notranslate"><code class="notranslate">Using module file /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ansible/modules/extras/system/zfs.py &lt;xxx.yyy.zzz&gt; ESTABLISH SSH CONNECTION FOR USER: root &lt;xxx.yyy.zzz&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/Users/guillaume/.ansible/cp/%p-%h-%r xxx.yyy.zzz '/bin/sh -c '"'"'/usr/bin/python2 &amp;&amp; sleep 0'"'"'' fatal: [xxx.yyy.zzz]: FAILED! =&gt; { "changed": false, "failed": true, "invocation": { "module_args": { "atime": "off", "canmount": "on", "casesensitivity": "sensitive", "checksum": "fletcher4", "compression": "lz4", "copies": "1", "createparent": null, "devices": "off", "exec": "off", "logbias": "latency", "mountpoint": "/var/lib/mysql", "nbmand": "off", "normalization": "formD", "primarycache": "metadata", "quota": "none", "readonly": "off", "recordsize": "16K", "refquota": "none", "refreservation": "none", "reservation": "none", "secondarycache": "none", "setuid": "off", "sharenfs": "off", "sharesmb": "off", "snapdir": "hidden", "utf8only": "on", "xattr": "off" }, "module_name": "zfs" }, "msg": "umount: /var/lib/mysql/relay_log: target is busy\n (In some cases useful info about processes that\n use the device is found by lsof(8) or fuser(1).)\ncannot unmount '/var/lib/mysql/relay_log': umount failed\n" } </code></pre></div>
1
<p dir="auto">Bayesian classifier for categorical data when we have observations in test data that not present in train data</p> <p dir="auto">can not believe you do not have it</p> <p dir="auto">since in real live it is always the case</p>
<h4 dir="auto">Describe the bug</h4> <p dir="auto">NB crashes when there is data in test data what was not used in train data<br> <a href="https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.CategoricalNB.html#sklearn.naive_bayes.CategoricalNB" rel="nofollow">https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.CategoricalNB.html#sklearn.naive_bayes.CategoricalNB</a></p> <p dir="auto">in real live test data values are different from train data</p>
1
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" python3 train_classes_v2.py --train 1/train/ --val 1/val/ --all 1/all/ Using TensorFlow backend. 2018-09-22 10:35:27.903598: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-09-22 10:35:28.554300: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but the re must be at least one NUMA node, so returning NUMA node zero 2018-09-22 10:35:28.554868: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties: name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7715 pciBusID: 0000:01:00.0 totalMemory: 7.92GiB freeMemory: 7.80GiB 2018-09-22 10:35:28.554883: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0 2018-09-22 10:35:28.731514: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix: 2018-09-22 10:35:28.731544: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929] 0 2018-09-22 10:35:28.731550: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0: N 2018-09-22 10:35:28.731704: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7537 MB memory) -&gt; physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1) Found 6400 images belonging to 32 classes. Found 1306 images belonging to 32 classes. Found 6522 images belonging to 32 classes. {'SKU49862': 15, 'SKU49871': 21, 'SKU49844': 3, 'SKU49845': 4, 'SKU49882': 22, 'SKU49981': 25, 'SKU49861': 14, 'SKU49985': 29, 'SKU49982': 26, 'SKU49883': 23 , 'SKU49865': 17, 'SKU49851': 10, 'SKU49984': 28, 'SKU49850': 9, 'SKU49843': 2, 'SKU49987': 31, 'SKU49849': 8, 'SKU49847': 6, 'SKU49855': 11, 'SKU49846': 5, 'SKU49860': 13, 'SKU49983': 27, 'SKU49864': 16, 'SKU49842': 1, 'SKU49866': 18, 'SKU49841': 0, 'SKU49986': 30, 'SKU49884': 24, 'SKU49867': 19, 'SKU49848': 7, 'SKU49868': 20, 'SKU49859': 12} steps_per_epoch: 6400.0 validation_steps: 1306.0 all_steps: 6522.0 Downloading data from https://github.com/titu1994/Keras-NASNet/releases/download/v1.2/NASNet-mobile-no-top.h5 19996672/19993432 [==============================] - 5s 0us/step _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= NASNet (Model) (None, 21, 7, 1056) 4269716 _________________________________________________________________ conv2d_1 (Conv2D) (None, 21, 7, 32) 33824 _________________________________________________________________ global_average_pooling2d_1 ( (None, 32) 0 _________________________________________________________________ softmax_1 (Softmax) (None, 32) 0 ================================================================= Total params: 4,303,540 Trainable params: 33,824 Non-trainable params: 4,269,716 _________________________________________________________________ None Epoch 1/1 6400/6400 [==============================] - 181s 28ms/step - loss: 3.4429 - acc: 0.0819 - val_loss: 3.4432 - val_acc: 0.0704 _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= NASNet (Model) (None, 21, 7, 1056) 4269716 _________________________________________________________________ conv2d_1 (Conv2D) (None, 21, 7, 32) 33824 _________________________________________________________________ global_average_pooling2d_1 ( (None, 32) 0 _________________________________________________________________ softmax_1 (Softmax) (None, 32) 0 ================================================================= Total params: 4,303,540 Trainable params: 4,266,802 Non-trainable params: 36,738 _________________________________________________________________ None Epoch 2/151 6400/6400 [==============================] - 1308s 204ms/step - loss: 2.1879 - acc: 0.6333 - val_loss: 3.3195 - val_acc: 0.4556 Epoch 3/151 6400/6400 [==============================] - 1265s 198ms/step - loss: 0.4105 - acc: 0.8980 - val_loss: 2.2126 - val_acc: 0.5383 Epoch 4/151 6400/6400 [==============================] - 1268s 198ms/step - loss: 0.1253 - acc: 0.9513 - val_loss: 1.4821 - val_acc: 0.6715 Epoch 5/151 6400/6400 [==============================] - 1270s 198ms/step - loss: 0.0915 - acc: 0.9677 - val_loss: 1.3620 - val_acc: 0.6715 Epoch 6/151 6400/6400 [==============================] - 1271s 199ms/step - loss: 0.0861 - acc: 0.9783 - val_loss: 1.4910 - val_acc: 0.7021 Epoch 7/151 6400/6400 [==============================] - 1272s 199ms/step - loss: 0.0590 - acc: 0.9908 - val_loss: 1.3748 - val_acc: 0.7175 Epoch 8/151 6400/6400 [==============================] - 1272s 199ms/step - loss: 0.0343 - acc: 0.9961 - val_loss: 1.4008 - val_acc: 0.7060 Epoch 9/151 6400/6400 [==============================] - 1270s 198ms/step - loss: 0.0249 - acc: 0.9972 - val_loss: 1.4543 - val_acc: 0.7136 Epoch 10/151 6400/6400 [==============================] - 1271s 199ms/step - loss: 0.0108 - acc: 0.9987 - val_loss: 1.4282 - val_acc: 0.6983 Epoch 00010: saving model to epoch-010_loss-0.01085_acc-0.99875_val_loss-1.42822_val_acc-0.69832.h5 Traceback (most recent call last): File &quot;train_classes_v2.py&quot;, line 338, in &lt;module&gt; _main(parser.parse_args()) File &quot;train_classes_v2.py&quot;, line 292, in _main use_multiprocessing=True, File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/legacy/interfaces.py&quot;, line 91, in wrapper return func(*args, **kwargs) File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/engine/training.py&quot;, line 1415, in fit_generator initial_epoch=initial_epoch) File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/engine/training_generator.py&quot;, line 247, in fit_generator callbacks.on_epoch_end(epoch, epoch_logs) File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/callbacks.py&quot;, line 77, in on_epoch_end callback.on_epoch_end(epoch, logs) File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/callbacks.py&quot;, line 455, in on_epoch_end self.model.save(filepath, overwrite=True) File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/engine/network.py&quot;, line 1085, in save save_model(self, filepath, overwrite, include_optimizer) File &quot;/home/michael/.local/lib/python3.5/site-packages/keras/engine/saving.py&quot;, line 174, in save_model 'weight_names'] = weight_names File &quot;h5py/_objects.pyx&quot;, line 54, in h5py._objects.with_phil.wrapper File &quot;h5py/_objects.pyx&quot;, line 55, in h5py._objects.with_phil.wrapper File &quot;/home/michael/.local/lib/python3.5/site-packages/h5py/_hl/attrs.py&quot;, line 95, in __setitem__ self.create(name, data=value, dtype=base.guess_dtype(value)) File &quot;/home/michael/.local/lib/python3.5/site-packages/h5py/_hl/attrs.py&quot;, line 188, in create attr = h5a.create(self._id, self._e(tempname), htype, space) File &quot;h5py/_objects.pyx&quot;, line 54, in h5py._objects.with_phil.wrapper File &quot;h5py/_objects.pyx&quot;, line 55, in h5py._objects.with_phil.wrapper File &quot;h5py/h5a.pyx&quot;, line 47, in h5py.h5a.create RuntimeError: Unable to create attribute (object header message is too large) "><pre class="notranslate"><code class="notranslate"> python3 train_classes_v2.py --train 1/train/ --val 1/val/ --all 1/all/ Using TensorFlow backend. 2018-09-22 10:35:27.903598: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-09-22 10:35:28.554300: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but the re must be at least one NUMA node, so returning NUMA node zero 2018-09-22 10:35:28.554868: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties: name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7715 pciBusID: 0000:01:00.0 totalMemory: 7.92GiB freeMemory: 7.80GiB 2018-09-22 10:35:28.554883: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0 2018-09-22 10:35:28.731514: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix: 2018-09-22 10:35:28.731544: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929] 0 2018-09-22 10:35:28.731550: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0: N 2018-09-22 10:35:28.731704: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7537 MB memory) -&gt; physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1) Found 6400 images belonging to 32 classes. Found 1306 images belonging to 32 classes. Found 6522 images belonging to 32 classes. {'SKU49862': 15, 'SKU49871': 21, 'SKU49844': 3, 'SKU49845': 4, 'SKU49882': 22, 'SKU49981': 25, 'SKU49861': 14, 'SKU49985': 29, 'SKU49982': 26, 'SKU49883': 23 , 'SKU49865': 17, 'SKU49851': 10, 'SKU49984': 28, 'SKU49850': 9, 'SKU49843': 2, 'SKU49987': 31, 'SKU49849': 8, 'SKU49847': 6, 'SKU49855': 11, 'SKU49846': 5, 'SKU49860': 13, 'SKU49983': 27, 'SKU49864': 16, 'SKU49842': 1, 'SKU49866': 18, 'SKU49841': 0, 'SKU49986': 30, 'SKU49884': 24, 'SKU49867': 19, 'SKU49848': 7, 'SKU49868': 20, 'SKU49859': 12} steps_per_epoch: 6400.0 validation_steps: 1306.0 all_steps: 6522.0 Downloading data from https://github.com/titu1994/Keras-NASNet/releases/download/v1.2/NASNet-mobile-no-top.h5 19996672/19993432 [==============================] - 5s 0us/step _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= NASNet (Model) (None, 21, 7, 1056) 4269716 _________________________________________________________________ conv2d_1 (Conv2D) (None, 21, 7, 32) 33824 _________________________________________________________________ global_average_pooling2d_1 ( (None, 32) 0 _________________________________________________________________ softmax_1 (Softmax) (None, 32) 0 ================================================================= Total params: 4,303,540 Trainable params: 33,824 Non-trainable params: 4,269,716 _________________________________________________________________ None Epoch 1/1 6400/6400 [==============================] - 181s 28ms/step - loss: 3.4429 - acc: 0.0819 - val_loss: 3.4432 - val_acc: 0.0704 _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= NASNet (Model) (None, 21, 7, 1056) 4269716 _________________________________________________________________ conv2d_1 (Conv2D) (None, 21, 7, 32) 33824 _________________________________________________________________ global_average_pooling2d_1 ( (None, 32) 0 _________________________________________________________________ softmax_1 (Softmax) (None, 32) 0 ================================================================= Total params: 4,303,540 Trainable params: 4,266,802 Non-trainable params: 36,738 _________________________________________________________________ None Epoch 2/151 6400/6400 [==============================] - 1308s 204ms/step - loss: 2.1879 - acc: 0.6333 - val_loss: 3.3195 - val_acc: 0.4556 Epoch 3/151 6400/6400 [==============================] - 1265s 198ms/step - loss: 0.4105 - acc: 0.8980 - val_loss: 2.2126 - val_acc: 0.5383 Epoch 4/151 6400/6400 [==============================] - 1268s 198ms/step - loss: 0.1253 - acc: 0.9513 - val_loss: 1.4821 - val_acc: 0.6715 Epoch 5/151 6400/6400 [==============================] - 1270s 198ms/step - loss: 0.0915 - acc: 0.9677 - val_loss: 1.3620 - val_acc: 0.6715 Epoch 6/151 6400/6400 [==============================] - 1271s 199ms/step - loss: 0.0861 - acc: 0.9783 - val_loss: 1.4910 - val_acc: 0.7021 Epoch 7/151 6400/6400 [==============================] - 1272s 199ms/step - loss: 0.0590 - acc: 0.9908 - val_loss: 1.3748 - val_acc: 0.7175 Epoch 8/151 6400/6400 [==============================] - 1272s 199ms/step - loss: 0.0343 - acc: 0.9961 - val_loss: 1.4008 - val_acc: 0.7060 Epoch 9/151 6400/6400 [==============================] - 1270s 198ms/step - loss: 0.0249 - acc: 0.9972 - val_loss: 1.4543 - val_acc: 0.7136 Epoch 10/151 6400/6400 [==============================] - 1271s 199ms/step - loss: 0.0108 - acc: 0.9987 - val_loss: 1.4282 - val_acc: 0.6983 Epoch 00010: saving model to epoch-010_loss-0.01085_acc-0.99875_val_loss-1.42822_val_acc-0.69832.h5 Traceback (most recent call last): File "train_classes_v2.py", line 338, in &lt;module&gt; _main(parser.parse_args()) File "train_classes_v2.py", line 292, in _main use_multiprocessing=True, File "/home/michael/.local/lib/python3.5/site-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "/home/michael/.local/lib/python3.5/site-packages/keras/engine/training.py", line 1415, in fit_generator initial_epoch=initial_epoch) File "/home/michael/.local/lib/python3.5/site-packages/keras/engine/training_generator.py", line 247, in fit_generator callbacks.on_epoch_end(epoch, epoch_logs) File "/home/michael/.local/lib/python3.5/site-packages/keras/callbacks.py", line 77, in on_epoch_end callback.on_epoch_end(epoch, logs) File "/home/michael/.local/lib/python3.5/site-packages/keras/callbacks.py", line 455, in on_epoch_end self.model.save(filepath, overwrite=True) File "/home/michael/.local/lib/python3.5/site-packages/keras/engine/network.py", line 1085, in save save_model(self, filepath, overwrite, include_optimizer) File "/home/michael/.local/lib/python3.5/site-packages/keras/engine/saving.py", line 174, in save_model 'weight_names'] = weight_names File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "/home/michael/.local/lib/python3.5/site-packages/h5py/_hl/attrs.py", line 95, in __setitem__ self.create(name, data=value, dtype=base.guess_dtype(value)) File "/home/michael/.local/lib/python3.5/site-packages/h5py/_hl/attrs.py", line 188, in create attr = h5a.create(self._id, self._e(tempname), htype, space) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5a.pyx", line 47, in h5py.h5a.create RuntimeError: Unable to create attribute (object header message is too large) </code></pre></div> <p dir="auto">Code:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import os.path import keras from keras.applications import NASNetMobile from keras.models import Sequential, model_from_json from keras.layers import Conv2D, GlobalAveragePooling2D, Softmax, Dropout from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau from keras.preprocessing.image import ImageDataGenerator import tensorflow as tf import json import argparse import glob import cv2 import numpy as np from sklearn.utils import class_weight BATCH_SIZE = 1 IMG_HEIGHT = 224 * 3 # ResNetInceptionv2 &amp; Xception: 299, ResNet50 &amp; VGG: 224 IMG_WIDTH = 224 DIMS = (IMG_HEIGHT, IMG_WIDTH, 3) HEAD_EPOCHES = 1 FINETUNING_EPOCHES = 150 ALL_EPOCHES = 50 def save_model(model, name, classes): # модель json_string = model.to_json() open(name + '.model.json', 'w').write(json_string) # список классов json_string = json.dumps(classes, indent=&quot;\t&quot;) open(name + '.classes.json', 'w').write(json_string) # веса модели model.save_weights(name + &quot;.weights.h5&quot;) # set tf backend to allow memory to grow, instead of claiming everything def get_session(cpu_only=False): num_cores = 4 config = tf.ConfigProto() if cpu_only: config = tf.ConfigProto( intra_op_parallelism_threads=num_cores, inter_op_parallelism_threads=num_cores, allow_soft_placement=True, device_count={ 'CPU': 1, 'GPU': 0 }) else: config = tf.ConfigProto( intra_op_parallelism_threads=num_cores, inter_op_parallelism_threads=num_cores, allow_soft_placement=True, device_count={ 'CPU': 1, 'GPU': 1 }) config.gpu_options.allow_growth = True return tf.Session(config=config) def _main(args): trainPath = args.train valPath = args.val allPath = args.all keras.backend.tensorflow_backend.set_session(get_session()) train_datagen = ImageDataGenerator( rescale=1. / 255, rotation_range=8, width_shift_range=0.1, height_shift_range=0.1, shear_range=8, zoom_range=0.1, samplewise_center=True, samplewise_std_normalization=True, fill_mode=&quot;constant&quot;, cval=0, ) val_datagen = ImageDataGenerator( rescale=1. / 255, samplewise_center=True, samplewise_std_normalization=True, ) train_generator = train_datagen.flow_from_directory( trainPath, target_size=(IMG_HEIGHT, IMG_WIDTH), batch_size=BATCH_SIZE, class_mode='categorical', interpolation=&quot;bicubic&quot;, #save_to_dir='aug', ) val_generator = val_datagen.flow_from_directory( valPath, target_size=(IMG_HEIGHT, IMG_WIDTH), batch_size=BATCH_SIZE, class_mode='categorical', interpolation=&quot;bicubic&quot;, #save_to_dir='aug2', ) all_generator = train_datagen.flow_from_directory( allPath, target_size=(IMG_HEIGHT, IMG_WIDTH), batch_size=BATCH_SIZE, class_mode='categorical', interpolation=&quot;bicubic&quot;, #save_to_dir='aug3', ) class_indices = train_generator.class_indices print(class_indices) num_of_classes = train_generator.num_classes num_of_samples = train_generator.samples steps_per_epoch = num_of_samples / BATCH_SIZE validation_steps = val_generator.samples / BATCH_SIZE all_steps = all_generator.samples / BATCH_SIZE print('steps_per_epoch: ' + str(steps_per_epoch)) print('validation_steps: ' + str(validation_steps)) print('all_steps: ' + str(all_steps)) class_weights = class_weight.compute_class_weight( 'balanced', np.unique(train_generator.classes), train_generator.classes) class_weights_all = class_weight.compute_class_weight( 'balanced', np.unique(all_generator.classes), all_generator.classes) callbacks = [ ModelCheckpoint( filepath='epoch-{epoch:03d}_loss-{loss:.5f}_acc-{acc:.5f}_val_loss-{val_loss:.5f}_val_acc-{val_acc:.5f}.h5', verbose=1, period=10), ] base_model = NASNetMobile(include_top=False, input_shape=DIMS) base_model.trainable = False model = Sequential() model.add(base_model) model.add(Conv2D(num_of_classes, (1, 1), activation='relu')) model.add(GlobalAveragePooling2D()) model.add(Softmax()) for layer in base_model.layers: if hasattr(layer, 'kernel_regularizer'): layer.kernel_regularizer= keras.regularizers.l2(0.00001) model.compile( loss='categorical_crossentropy', optimizer=keras.optimizers.adam(lr=1e-5, clipnorm=0.001), metrics=['acc']) print(model.summary()) history = model.fit_generator( train_generator, class_weight=class_weights, steps_per_epoch=steps_per_epoch, epochs=HEAD_EPOCHES, validation_data=val_generator, validation_steps=validation_steps, verbose=1, callbacks=callbacks, workers=8, use_multiprocessing=True, ) base_model.trainable = True model.compile( loss='categorical_crossentropy', optimizer=keras.optimizers.adam(lr=1e-5, clipnorm=0.001), metrics=['acc']) print(model.summary()) history = model.fit_generator( train_generator, class_weight=class_weights, steps_per_epoch=steps_per_epoch, initial_epoch=HEAD_EPOCHES, epochs=HEAD_EPOCHES + FINETUNING_EPOCHES, validation_data=val_generator, validation_steps=validation_steps, verbose=1, callbacks=callbacks, workers=8, use_multiprocessing=True, ) callbacks = [ ModelCheckpoint( filepath='epoch-{epoch:03d}_loss-{loss:.5f}_acc-{acc:.5f}.h5', verbose=1, period=10), ReduceLROnPlateau( monitor='acc', factor=0.94, patience=5, verbose=1, min_lr=0), ] history = model.fit_generator( all_generator, class_weight=class_weights_all, steps_per_epoch=all_steps, initial_epoch=HEAD_EPOCHES + FINETUNING_EPOCHES, epochs=HEAD_EPOCHES + FINETUNING_EPOCHES + ALL_EPOCHES, verbose=1, callbacks=callbacks, workers=8, use_multiprocessing=True, ) save_model(model, 'image-classification', class_indices) if __name__ == '__main__': parser = argparse.ArgumentParser( epilog=&quot;Example: python3 train_classes.py --train tmp/train/ --val tmp/val/ --all tmp/all/&quot;) parser.add_argument( '--train', help='Path to tarin dataset. Example: --train tmp/train/') parser.add_argument( '--val', help='Path to validation dataset. Example: --val tmp/val/') parser.add_argument( '--all', help='Path to all dataset with tain and validation images. Example: --all tmp/all/') _main(parser.parse_args())"><pre class="notranslate"><code class="notranslate">import os.path import keras from keras.applications import NASNetMobile from keras.models import Sequential, model_from_json from keras.layers import Conv2D, GlobalAveragePooling2D, Softmax, Dropout from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau from keras.preprocessing.image import ImageDataGenerator import tensorflow as tf import json import argparse import glob import cv2 import numpy as np from sklearn.utils import class_weight BATCH_SIZE = 1 IMG_HEIGHT = 224 * 3 # ResNetInceptionv2 &amp; Xception: 299, ResNet50 &amp; VGG: 224 IMG_WIDTH = 224 DIMS = (IMG_HEIGHT, IMG_WIDTH, 3) HEAD_EPOCHES = 1 FINETUNING_EPOCHES = 150 ALL_EPOCHES = 50 def save_model(model, name, classes): # модель json_string = model.to_json() open(name + '.model.json', 'w').write(json_string) # список классов json_string = json.dumps(classes, indent="\t") open(name + '.classes.json', 'w').write(json_string) # веса модели model.save_weights(name + ".weights.h5") # set tf backend to allow memory to grow, instead of claiming everything def get_session(cpu_only=False): num_cores = 4 config = tf.ConfigProto() if cpu_only: config = tf.ConfigProto( intra_op_parallelism_threads=num_cores, inter_op_parallelism_threads=num_cores, allow_soft_placement=True, device_count={ 'CPU': 1, 'GPU': 0 }) else: config = tf.ConfigProto( intra_op_parallelism_threads=num_cores, inter_op_parallelism_threads=num_cores, allow_soft_placement=True, device_count={ 'CPU': 1, 'GPU': 1 }) config.gpu_options.allow_growth = True return tf.Session(config=config) def _main(args): trainPath = args.train valPath = args.val allPath = args.all keras.backend.tensorflow_backend.set_session(get_session()) train_datagen = ImageDataGenerator( rescale=1. / 255, rotation_range=8, width_shift_range=0.1, height_shift_range=0.1, shear_range=8, zoom_range=0.1, samplewise_center=True, samplewise_std_normalization=True, fill_mode="constant", cval=0, ) val_datagen = ImageDataGenerator( rescale=1. / 255, samplewise_center=True, samplewise_std_normalization=True, ) train_generator = train_datagen.flow_from_directory( trainPath, target_size=(IMG_HEIGHT, IMG_WIDTH), batch_size=BATCH_SIZE, class_mode='categorical', interpolation="bicubic", #save_to_dir='aug', ) val_generator = val_datagen.flow_from_directory( valPath, target_size=(IMG_HEIGHT, IMG_WIDTH), batch_size=BATCH_SIZE, class_mode='categorical', interpolation="bicubic", #save_to_dir='aug2', ) all_generator = train_datagen.flow_from_directory( allPath, target_size=(IMG_HEIGHT, IMG_WIDTH), batch_size=BATCH_SIZE, class_mode='categorical', interpolation="bicubic", #save_to_dir='aug3', ) class_indices = train_generator.class_indices print(class_indices) num_of_classes = train_generator.num_classes num_of_samples = train_generator.samples steps_per_epoch = num_of_samples / BATCH_SIZE validation_steps = val_generator.samples / BATCH_SIZE all_steps = all_generator.samples / BATCH_SIZE print('steps_per_epoch: ' + str(steps_per_epoch)) print('validation_steps: ' + str(validation_steps)) print('all_steps: ' + str(all_steps)) class_weights = class_weight.compute_class_weight( 'balanced', np.unique(train_generator.classes), train_generator.classes) class_weights_all = class_weight.compute_class_weight( 'balanced', np.unique(all_generator.classes), all_generator.classes) callbacks = [ ModelCheckpoint( filepath='epoch-{epoch:03d}_loss-{loss:.5f}_acc-{acc:.5f}_val_loss-{val_loss:.5f}_val_acc-{val_acc:.5f}.h5', verbose=1, period=10), ] base_model = NASNetMobile(include_top=False, input_shape=DIMS) base_model.trainable = False model = Sequential() model.add(base_model) model.add(Conv2D(num_of_classes, (1, 1), activation='relu')) model.add(GlobalAveragePooling2D()) model.add(Softmax()) for layer in base_model.layers: if hasattr(layer, 'kernel_regularizer'): layer.kernel_regularizer= keras.regularizers.l2(0.00001) model.compile( loss='categorical_crossentropy', optimizer=keras.optimizers.adam(lr=1e-5, clipnorm=0.001), metrics=['acc']) print(model.summary()) history = model.fit_generator( train_generator, class_weight=class_weights, steps_per_epoch=steps_per_epoch, epochs=HEAD_EPOCHES, validation_data=val_generator, validation_steps=validation_steps, verbose=1, callbacks=callbacks, workers=8, use_multiprocessing=True, ) base_model.trainable = True model.compile( loss='categorical_crossentropy', optimizer=keras.optimizers.adam(lr=1e-5, clipnorm=0.001), metrics=['acc']) print(model.summary()) history = model.fit_generator( train_generator, class_weight=class_weights, steps_per_epoch=steps_per_epoch, initial_epoch=HEAD_EPOCHES, epochs=HEAD_EPOCHES + FINETUNING_EPOCHES, validation_data=val_generator, validation_steps=validation_steps, verbose=1, callbacks=callbacks, workers=8, use_multiprocessing=True, ) callbacks = [ ModelCheckpoint( filepath='epoch-{epoch:03d}_loss-{loss:.5f}_acc-{acc:.5f}.h5', verbose=1, period=10), ReduceLROnPlateau( monitor='acc', factor=0.94, patience=5, verbose=1, min_lr=0), ] history = model.fit_generator( all_generator, class_weight=class_weights_all, steps_per_epoch=all_steps, initial_epoch=HEAD_EPOCHES + FINETUNING_EPOCHES, epochs=HEAD_EPOCHES + FINETUNING_EPOCHES + ALL_EPOCHES, verbose=1, callbacks=callbacks, workers=8, use_multiprocessing=True, ) save_model(model, 'image-classification', class_indices) if __name__ == '__main__': parser = argparse.ArgumentParser( epilog="Example: python3 train_classes.py --train tmp/train/ --val tmp/val/ --all tmp/all/") parser.add_argument( '--train', help='Path to tarin dataset. Example: --train tmp/train/') parser.add_argument( '--val', help='Path to validation dataset. Example: --val tmp/val/') parser.add_argument( '--all', help='Path to all dataset with tain and validation images. Example: --all tmp/all/') _main(parser.parse_args()) </code></pre></div>
<p dir="auto">When trying to save my model I get the runtime error below. There was a similar issue when model layers names were too long and it can be solved by giving layers shorter names. This time the error pops up when saving optimizer weights. getattr(model.optimizer,'weights') shows</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[&lt;tf.Variable 'Adam/iterations:0' shape=() dtype=int64_ref&gt;, &lt;tf.Variable 'training/Adam/Variable:0' shape=(3, 3, 1, 64) dtype=float32_ref&gt;, &lt;tf.Variable 'training/Adam/Variable_1:0' shape=(64,) dtype=float32_ref&gt;, &lt;tf.Variable 'training/Adam/Variable_2:0' shape=(64,) dtype=float32_ref&gt;, ...] "><pre class="notranslate"><code class="notranslate">[&lt;tf.Variable 'Adam/iterations:0' shape=() dtype=int64_ref&gt;, &lt;tf.Variable 'training/Adam/Variable:0' shape=(3, 3, 1, 64) dtype=float32_ref&gt;, &lt;tf.Variable 'training/Adam/Variable_1:0' shape=(64,) dtype=float32_ref&gt;, &lt;tf.Variable 'training/Adam/Variable_2:0' shape=(64,) dtype=float32_ref&gt;, ...] </code></pre></div> <p dir="auto">and if I convert it to numpy array its length is above the 64k limits which gives h5 runtime. I can save the model if I use save_model(....,include_optimizer=False) but I need the optimizer state. Is there any way I can reduce the length of "training/Adam/Variable:0"... names so as to fit them into 64k hdf5 table limit. Thanks.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) &lt;ipython-input-130-d231b4a5a40c&gt; in &lt;module&gt;() ----&gt; 1 model.save('model') C:\Anaconda3\lib\site-packages\keras\engine\network.py in save(self, filepath, overwrite, include_optimizer) 1083 raise NotImplementedError 1084 from ..models import save_model -&gt; 1085 save_model(self, filepath, overwrite, include_optimizer) 1086 1087 def save_weights(self, filepath, overwrite=True): C:\Anaconda3\lib\site-packages\keras\engine\saving.py in save_model(model, filepath, overwrite, include_optimizer) 173 #print('Weight names',weight_names,len(weight_names),np.asarray(weight_names).nbytes) 174 optimizer_weights_group.attrs[ --&gt; 175 'weight_names'] = weight_names 176 for name, val in zip(weight_names, weight_values): 177 param_dset = optimizer_weights_group.create_dataset( h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() C:\Anaconda3\lib\site-packages\h5py\_hl\attrs.py in __setitem__(self, name, value) 93 use the methods create() and modify(). 94 &quot;&quot;&quot; ---&gt; 95 self.create(name, data=value, dtype=base.guess_dtype(value)) 96 97 @with_phil C:\Anaconda3\lib\site-packages\h5py\_hl\attrs.py in create(self, name, data, shape, dtype) 186 187 try: --&gt; 188 attr = h5a.create(self._id, self._e(tempname), htype, space) 189 except: 190 raise h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5a.pyx in h5py.h5a.create() RuntimeError: Unable to create attribute (object header message is too large)"><pre class="notranslate"><code class="notranslate">--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) &lt;ipython-input-130-d231b4a5a40c&gt; in &lt;module&gt;() ----&gt; 1 model.save('model') C:\Anaconda3\lib\site-packages\keras\engine\network.py in save(self, filepath, overwrite, include_optimizer) 1083 raise NotImplementedError 1084 from ..models import save_model -&gt; 1085 save_model(self, filepath, overwrite, include_optimizer) 1086 1087 def save_weights(self, filepath, overwrite=True): C:\Anaconda3\lib\site-packages\keras\engine\saving.py in save_model(model, filepath, overwrite, include_optimizer) 173 #print('Weight names',weight_names,len(weight_names),np.asarray(weight_names).nbytes) 174 optimizer_weights_group.attrs[ --&gt; 175 'weight_names'] = weight_names 176 for name, val in zip(weight_names, weight_values): 177 param_dset = optimizer_weights_group.create_dataset( h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() C:\Anaconda3\lib\site-packages\h5py\_hl\attrs.py in __setitem__(self, name, value) 93 use the methods create() and modify(). 94 """ ---&gt; 95 self.create(name, data=value, dtype=base.guess_dtype(value)) 96 97 @with_phil C:\Anaconda3\lib\site-packages\h5py\_hl\attrs.py in create(self, name, data, shape, dtype) 186 187 try: --&gt; 188 attr = h5a.create(self._id, self._e(tempname), htype, space) 189 except: 190 raise h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5a.pyx in h5py.h5a.create() RuntimeError: Unable to create attribute (object header message is too large) </code></pre></div> <p dir="auto">Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question on <a href="http://stackoverflow.com/questions/tagged/keras" rel="nofollow">StackOverflow</a> or <a href="https://keras-slack-autojoin.herokuapp.com/" rel="nofollow">join the Keras Slack channel</a> and ask there instead of filing a GitHub issue.</p> <p dir="auto">Thank you!</p> <ul class="contains-task-list"> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Check that you are up-to-date with the master branch of Keras. You can update with:<br> pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps</p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found <a href="https://www.tensorflow.org/get_started/os_setup" rel="nofollow">here</a>.</p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:<br> pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps</p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).</p> </li> </ul>
1
<h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have read the relevant section in the<br> <a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br> on reporting bugs.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br> to find out if the bug was already fixed in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all related issues and possible duplicate issues<br> in this issue (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Mandatory Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br> (if you are not able to do this, then at least specify the Celery<br> version affected).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have included all the versions of all the external dependencies required<br> to reproduce this bug.</li> </ul> <h2 dir="auto">Optional Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br> and/or implementation.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br> result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br> broker and/or result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br> ETA/Countdown &amp; rate limits disabled.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue after downgrading<br> and/or upgrading Celery and its dependencies.</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h2 dir="auto">Environment &amp; Settings</h2> <p dir="auto"><strong>Celery version</strong>: 5.0?5</p> <details> <summary><b><code class="notranslate">celery report</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ venv/bin/celery -A celery_worker.celery_app worker --loglevel=info 2021-01-25 14:59:57,746 - job - INFO - __init__ - Starting job celery worker in version 1.4.3 2021-01-25 14:59:57,750 - job - INFO - database - Initializing connection to database... 2021-01-25 14:59:57,752 - job - INFO - database - Connected ! 2021-01-25 14:59:57,768 - job - DEBUG - __init__ - Registring celery tasks... 2021-01-25 14:59:58,056 - job - DEBUG - __init__ - Registered ! 2021-01-25 14:59:58,056 - job - INFO - __init__ - Celery workers started ! [2021-01-25 14:59:58,101: DEBUG/MainProcess] | Worker: Preparing bootsteps. [2021-01-25 14:59:58,104: DEBUG/MainProcess] | Worker: Building graph... [2021-01-25 14:59:58,105: DEBUG/MainProcess] | Worker: New boot order: {StateDB, Beat, Timer, Hub, Pool, Autoscaler, Consumer} [2021-01-25 14:59:58,120: DEBUG/MainProcess] | Consumer: Preparing bootsteps. [2021-01-25 14:59:58,120: DEBUG/MainProcess] | Consumer: Building graph... [2021-01-25 14:59:58,161: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Agent, Events, Mingle, Tasks, Control, Heart, Gossip, event loop} -------------- celery@hostname v5.0.5 (singularity) --- ***** ----- -- ******* ---- Linux-3.10.0-514.21.2.el7.x86_64-x86_64-with-redhat-7.3-Maipo 2021-01-25 14:59:58 - *** --- * --- - ** ---------- [config] - ** ---------- .&gt; app: job:0x7fc7ac843d90 - ** ---------- .&gt; transport: amqp://celery:**@localhost:5672//job_celery - ** ---------- .&gt; results: mongodb:// - *** --- * --- .&gt; concurrency: 8 (prefork) -- ******* ---- .&gt; task events: OFF (enable -E to monitor tasks in this worker) --- ***** ----- -------------- [queues] .&gt; celery exchange=celery(direct) key=celery [tasks] . app.lib.celery_beat._delete_from_schedule . app.lib.celery_beat._update_job_schedule . app.lib.celery_beat.schedule_job "><pre class="notranslate"><code class="notranslate">$ venv/bin/celery -A celery_worker.celery_app worker --loglevel=info 2021-01-25 14:59:57,746 - job - INFO - __init__ - Starting job celery worker in version 1.4.3 2021-01-25 14:59:57,750 - job - INFO - database - Initializing connection to database... 2021-01-25 14:59:57,752 - job - INFO - database - Connected ! 2021-01-25 14:59:57,768 - job - DEBUG - __init__ - Registring celery tasks... 2021-01-25 14:59:58,056 - job - DEBUG - __init__ - Registered ! 2021-01-25 14:59:58,056 - job - INFO - __init__ - Celery workers started ! [2021-01-25 14:59:58,101: DEBUG/MainProcess] | Worker: Preparing bootsteps. [2021-01-25 14:59:58,104: DEBUG/MainProcess] | Worker: Building graph... [2021-01-25 14:59:58,105: DEBUG/MainProcess] | Worker: New boot order: {StateDB, Beat, Timer, Hub, Pool, Autoscaler, Consumer} [2021-01-25 14:59:58,120: DEBUG/MainProcess] | Consumer: Preparing bootsteps. [2021-01-25 14:59:58,120: DEBUG/MainProcess] | Consumer: Building graph... [2021-01-25 14:59:58,161: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Agent, Events, Mingle, Tasks, Control, Heart, Gossip, event loop} -------------- celery@hostname v5.0.5 (singularity) --- ***** ----- -- ******* ---- Linux-3.10.0-514.21.2.el7.x86_64-x86_64-with-redhat-7.3-Maipo 2021-01-25 14:59:58 - *** --- * --- - ** ---------- [config] - ** ---------- .&gt; app: job:0x7fc7ac843d90 - ** ---------- .&gt; transport: amqp://celery:**@localhost:5672//job_celery - ** ---------- .&gt; results: mongodb:// - *** --- * --- .&gt; concurrency: 8 (prefork) -- ******* ---- .&gt; task events: OFF (enable -E to monitor tasks in this worker) --- ***** ----- -------------- [queues] .&gt; celery exchange=celery(direct) key=celery [tasks] . app.lib.celery_beat._delete_from_schedule . app.lib.celery_beat._update_job_schedule . app.lib.celery_beat.schedule_job </code></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Steps to Reproduce</h1> <h2 dir="auto">Required Dependencies</h2> <ul dir="auto"> <li><strong>Minimal Python Version</strong>: 3.7.4</li> <li><strong>Minimal Celery Version</strong>: 5.0.5</li> <li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Version</strong>: RabbitMQ 3.8.0</li> <li><strong>Minimal Result Backend Version</strong>: MongoDb 4.2.0</li> <li><strong>Minimal OS and/or Kernel Version</strong>: Redhat7 3.10.0-514.21.2.el7.x86_64</li> <li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li> </ul> <h3 dir="auto">Python Packages</h3> <details> <summary><b><code class="notranslate">pip freeze</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="amqp==5.0.3 astroid==2.3.3 attrs==19.3.0 autopep8==1.4.4 Babel==2.7.0 billiard==3.6.3.0 celery==5.0.5 celerybeat-mongo==0.2.0 celerybeatmongo==0.1.2 certifi==2019.9.11 cffi==1.14.0 chardet==3.0.4 Click==7.0 click-didyoumean==0.0.3 click-plugins==1.1.1 click-repl==0.1.6 coverage==4.5.4 cryptography==2.9.2 fernet==1.0.1 fixtures-mongoengine==1.3.1 Flask==1.1.1 Flask-Babel==0.12.2 Flask-Session==0.3.1 Flask-WTF==0.14.2 idna==2.8 importlib-metadata==1.5.0 isodate==0.6.0 isort==4.3.21 itsdangerous==1.1.0 Jinja2==2.11.1 jsonschema==3.2.0 kombu==5.0.2 lazy-object-proxy==1.4.3 MarkupSafe==1.1.1 marshmallow==3.6.1 mccabe==0.6.1 mongoengine==0.18.2 paho-mqtt==1.4.0 prompt-toolkit==3.0.11 pyaes==1.6.1 pycodestyle==2.5.0 pycparser==2.20 pylint==2.4.2 pymongo==3.9.0 pyrsistent==0.15.7 python-dateutil==2.8.1 pytz==2019.3 PyYAML==5.3 requests==2.22.0 semver==2.9.0 six==1.12.0 typed-ast==1.4.1 urllib3==1.25.6 vine==5.0.0 wcwidth==0.2.5 Werkzeug==0.16.0 wrapt==1.11.2 WTForms==2.2.1 zipp==2.1.0"><pre class="notranslate"><code class="notranslate">amqp==5.0.3 astroid==2.3.3 attrs==19.3.0 autopep8==1.4.4 Babel==2.7.0 billiard==3.6.3.0 celery==5.0.5 celerybeat-mongo==0.2.0 celerybeatmongo==0.1.2 certifi==2019.9.11 cffi==1.14.0 chardet==3.0.4 Click==7.0 click-didyoumean==0.0.3 click-plugins==1.1.1 click-repl==0.1.6 coverage==4.5.4 cryptography==2.9.2 fernet==1.0.1 fixtures-mongoengine==1.3.1 Flask==1.1.1 Flask-Babel==0.12.2 Flask-Session==0.3.1 Flask-WTF==0.14.2 idna==2.8 importlib-metadata==1.5.0 isodate==0.6.0 isort==4.3.21 itsdangerous==1.1.0 Jinja2==2.11.1 jsonschema==3.2.0 kombu==5.0.2 lazy-object-proxy==1.4.3 MarkupSafe==1.1.1 marshmallow==3.6.1 mccabe==0.6.1 mongoengine==0.18.2 paho-mqtt==1.4.0 prompt-toolkit==3.0.11 pyaes==1.6.1 pycodestyle==2.5.0 pycparser==2.20 pylint==2.4.2 pymongo==3.9.0 pyrsistent==0.15.7 python-dateutil==2.8.1 pytz==2019.3 PyYAML==5.3 requests==2.22.0 semver==2.9.0 six==1.12.0 typed-ast==1.4.1 urllib3==1.25.6 vine==5.0.0 wcwidth==0.2.5 Werkzeug==0.16.0 wrapt==1.11.2 WTForms==2.2.1 zipp==2.1.0 </code></pre></div> <p dir="auto"></p> </details> <h3 dir="auto">Other Dependencies</h3> <details> <p dir="auto"> </p><p dir="auto">Logs for celery beat worker</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2021-01-25 16:01:36,438 - job - INFO - __init__ - Starting job beat in version 1.4.3 2021-01-25 16:01:36,442 - job - INFO - database - Initializing connection to database... 2021-01-25 16:01:36,445 - job - INFO - database - Connected ! 2021-01-25 16:01:36,460 - job - DEBUG - __init__ - Registring celery beats... 2021-01-25 16:01:36,833 - job - DEBUG - __init__ - Registered ! 2021-01-25 16:01:36,833 - job - INFO - __init__ - Celery beats started ! celery beat v5.0.5 (singularity) is starting. __ - ... __ - _ LocalTime -&gt; 2021-01-25 16:01:36 Configuration -&gt; . broker -&gt; amqp://celery:**@localhost:5672//job_celery . loader -&gt; celery.loaders.app.AppLoader . scheduler -&gt; celerybeatmongo.schedulers.MongoScheduler . logfile -&gt; [stderr]@%DEBUG . maxinterval -&gt; 5.00 seconds (5s) [2021-01-25 16:01:36,894: DEBUG/MainProcess] Setting default socket timeout to 30 [2021-01-25 16:01:36,895: INFO/MainProcess] beat: Starting... [2021-01-25 16:01:36,895: DEBUG/MainProcess] mongodb_scheduler_db: heron [2021-01-25 16:01:36,896: DEBUG/MainProcess] mongodb_scheduler_connection_alias: job_beat [2021-01-25 16:01:36,896: DEBUG/MainProcess] mongodb_scheduler_url: mongodb://user:[email protected]:27017 [2021-01-25 16:01:36,896: INFO/MainProcess] backend scheduler using mongodb://user:[email protected]:27017/app:job_schedules [2021-01-25 16:01:36,896: DEBUG/MainProcess] beat: Ticking with max interval-&gt;5.00 seconds [2021-01-25 16:01:36,896: DEBUG/MainProcess] Writing entries..."><pre class="notranslate"><code class="notranslate">2021-01-25 16:01:36,438 - job - INFO - __init__ - Starting job beat in version 1.4.3 2021-01-25 16:01:36,442 - job - INFO - database - Initializing connection to database... 2021-01-25 16:01:36,445 - job - INFO - database - Connected ! 2021-01-25 16:01:36,460 - job - DEBUG - __init__ - Registring celery beats... 2021-01-25 16:01:36,833 - job - DEBUG - __init__ - Registered ! 2021-01-25 16:01:36,833 - job - INFO - __init__ - Celery beats started ! celery beat v5.0.5 (singularity) is starting. __ - ... __ - _ LocalTime -&gt; 2021-01-25 16:01:36 Configuration -&gt; . broker -&gt; amqp://celery:**@localhost:5672//job_celery . loader -&gt; celery.loaders.app.AppLoader . scheduler -&gt; celerybeatmongo.schedulers.MongoScheduler . logfile -&gt; [stderr]@%DEBUG . maxinterval -&gt; 5.00 seconds (5s) [2021-01-25 16:01:36,894: DEBUG/MainProcess] Setting default socket timeout to 30 [2021-01-25 16:01:36,895: INFO/MainProcess] beat: Starting... [2021-01-25 16:01:36,895: DEBUG/MainProcess] mongodb_scheduler_db: heron [2021-01-25 16:01:36,896: DEBUG/MainProcess] mongodb_scheduler_connection_alias: job_beat [2021-01-25 16:01:36,896: DEBUG/MainProcess] mongodb_scheduler_url: mongodb://user:[email protected]:27017 [2021-01-25 16:01:36,896: INFO/MainProcess] backend scheduler using mongodb://user:[email protected]:27017/app:job_schedules [2021-01-25 16:01:36,896: DEBUG/MainProcess] beat: Ticking with max interval-&gt;5.00 seconds [2021-01-25 16:01:36,896: DEBUG/MainProcess] Writing entries... </code></pre></div> <p dir="auto"></p> </details> <h2 dir="auto">Minimally Reproducible Test Case</h2> <details> <p dir="auto"> </p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Expected Behavior</h1> <p dir="auto">I would like my scheduled job run at CET time.</p> <h1 dir="auto">Actual Behavior</h1> <p dir="auto">I have set the conf as :</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CELERY_TIMEZONE = 'Europe/Paris' CELERY_ENABLE_UTC = False"><pre class="notranslate"><code class="notranslate">CELERY_TIMEZONE = 'Europe/Paris' CELERY_ENABLE_UTC = False </code></pre></div> <p dir="auto">I store my schedule job in mongoDB with celerybeat-mongo and each time a job run for the first time, the value of last_run_at become a datetime field in mongo in UTC and my job never run any more at the CET time.<br> I have feeling that when getting the data from mongo, the DateTime Fields which keep the value of last_run_at, there is a problem when comparing the tzinfo.</p> <p dir="auto">When I look at tzinfo from now(), I get <em>Europe/Paris</em> and from the last_run_at: <em>&lt;bson.tz_util.FixedOffset object at 0x7fefef163590&gt;</em><br> But I'm not able to find where is the source of the issue, is it from celerybeat-mongo or from celery ?</p>
<p dir="auto"><code class="notranslate">Celery.send_task</code> from <code class="notranslate">base.py</code> is trying to call <code class="notranslate">AMQP.as_task_v2</code> with the <code class="notranslate">ignore_result</code> argument, which is not available on 5.0.6.</p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/171ab0268ef65a6b4302ae423641f3d3b005afc4/celery/app/base.py#L744">celery/celery/app/base.py</a> </p> <p class="mb-0 color-fg-muted"> Line 744 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/171ab0268ef65a6b4302ae423641f3d3b005afc4">171ab02</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L744" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="744"></td> <td id="LC744" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">ignore_result</span><span class="pl-c1">=</span><span class="pl-s1">ignore_result</span>, </td> </tr> </tbody></table> </div> </div> <p></p> <p dir="auto"></p><div class="Box Box--condensed my-2"> <div class="Box-header f6"> <p class="mb-0 text-bold"> <a href="https://github.com/celery/celery/blob/171ab0268ef65a6b4302ae423641f3d3b005afc4/celery/app/amqp.py#L280-L287">celery/celery/app/amqp.py</a> </p> <p class="mb-0 color-fg-muted"> Lines 280 to 287 in <a data-pjax="true" class="commit-tease-sha" href="/celery/celery/commit/171ab0268ef65a6b4302ae423641f3d3b005afc4">171ab02</a> </p> </div> <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data"> <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip=""> <tbody><tr class="border-0"> <td id="L280" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="280"></td> <td id="LC280" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">def</span> <span class="pl-en">as_task_v2</span>(<span class="pl-s1">self</span>, <span class="pl-s1">task_id</span>, <span class="pl-s1">name</span>, <span class="pl-s1">args</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">kwargs</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L281" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="281"></td> <td id="LC281" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">countdown</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">eta</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">group_id</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">group_index</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L282" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="282"></td> <td id="LC282" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">expires</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">retries</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">chord</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L283" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="283"></td> <td id="LC283" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">callbacks</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">errbacks</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">reply_to</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L284" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="284"></td> <td id="LC284" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">time_limit</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">soft_time_limit</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L285" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="285"></td> <td id="LC285" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">create_sent_event</span><span class="pl-c1">=</span><span class="pl-c1">False</span>, <span class="pl-s1">root_id</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">parent_id</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L286" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="286"></td> <td id="LC286" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">shadow</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">chain</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">now</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">timezone</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, </td> </tr> <tr class="border-0"> <td id="L287" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="287"></td> <td id="LC287" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s1">origin</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">argsrepr</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">kwargsrepr</span><span class="pl-c1">=</span><span class="pl-c1">None</span>): </td> </tr> </tbody></table> </div> </div> <p></p> <h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have read the relevant section in the<br> <a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br> on reporting bugs.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br> to find out if the bug was already fixed in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br> in this issue (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Mandatory Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br> (if you are not able to do this, then at least specify the Celery<br> version affected).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br> to reproduce this bug.</li> </ul> <h2 dir="auto">Optional Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have tried reproducing the issue on more than one Python version<br> and/or implementation.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br> result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br> broker and/or result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br> ETA/Countdown &amp; rate limits disabled.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br> and/or upgrading Celery and its dependencies.</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h2 dir="auto">Environment &amp; Settings</h2> <p dir="auto"><strong>Celery version</strong>:</p> <details> <summary><b><code class="notranslate">celery report</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Steps to Reproduce</h1> <h2 dir="auto">Required Dependencies</h2> <ul dir="auto"> <li><strong>Minimal Python Version</strong>: N/A or Unknown</li> <li><strong>Minimal Celery Version</strong>: N/A or Unknown</li> <li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li> <li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li> </ul> <h3 dir="auto">Python Packages</h3> <details> <summary><b><code class="notranslate">pip freeze</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h3 dir="auto">Other Dependencies</h3> <details> <p dir="auto"> N/A </p> </details> <h2 dir="auto">Minimally Reproducible Test Case</h2> <details> <p dir="auto"> </p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Expected Behavior</h1> <h1 dir="auto">Actual Behavior</h1>
0
<p dir="auto">I just accepted a pull required for the <code class="notranslate">Hwloc</code> package to make it compatible with Julia 0.6. I now want to tag a new minor release, so that people can depend on this change. Unfortunately, I see error messages when trying to publish this tag. I tried this both from a 0.6 and 0.5 Julia release.</p> <p dir="auto">I did this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Pkg.update() using PkgDev PkgDev.tag(&quot;Hwloc&quot;, :minor) PkgDev.publish()"><pre class="notranslate"><code class="notranslate">Pkg.update() using PkgDev PkgDev.tag("Hwloc", :minor) PkgDev.publish() </code></pre></div> <p dir="auto">The last step -- <code class="notranslate">Pkg.publish()</code> -- fails (see below). The first step -- <code class="notranslate">Pkg.update()</code> -- probably reported some warning or errors at some point. It often does this, since I have some experimental packages. When I run <code class="notranslate">Pkg.update()</code> or <code class="notranslate">Pkg.status()</code> now, there are no errors or warnings reported.</p> <p dir="auto">This is the error I see (with Julia 0.5):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; PkgDev.publish() INFO: Validating METADATA ERROR: packages with unsatisfiable requirements found: EEG v0.0.3 – no valid versions exist for package ImageFiltering in check_metadata(::Set{String}) at /Users/eschnett/.julia/v0.5/PkgDev/src/entry.jl:301 in (::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String})(::Base.LibGit2.GitRepo) at /Users/eschnett/.julia/v0.5/PkgDev/src/entry.jl:93 in with(::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:701 in publish(::String, ::String) at /Users/eschnett/.julia/v0.5/PkgDev/src/entry.jl:64 in publish() at /Users/eschnett/.julia/v0.5/PkgDev/src/PkgDev.jl:70"><pre class="notranslate"><code class="notranslate">julia&gt; PkgDev.publish() INFO: Validating METADATA ERROR: packages with unsatisfiable requirements found: EEG v0.0.3 – no valid versions exist for package ImageFiltering in check_metadata(::Set{String}) at /Users/eschnett/.julia/v0.5/PkgDev/src/entry.jl:301 in (::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String})(::Base.LibGit2.GitRepo) at /Users/eschnett/.julia/v0.5/PkgDev/src/entry.jl:93 in with(::PkgDev.Entry.##4#9{String,Dict{String,Array{String,1}},String}, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:701 in publish(::String, ::String) at /Users/eschnett/.julia/v0.5/PkgDev/src/entry.jl:64 in publish() at /Users/eschnett/.julia/v0.5/PkgDev/src/PkgDev.jl:70 </code></pre></div> <p dir="auto">I have several suggestions here.</p> <ol dir="auto"> <li> <p dir="auto">I just want to publish a new tag. This should not require me to debug my full package layout. It's easy to get stuck in the woods with packages, in particular if you develop packages yourself or look at the head of other packages. It's at the same time very difficult to work around this since Julia packages are installed globally, i.e. I can't simply install a new, separate version of Julia where I would only check out, tag, and publish <code class="notranslate">Hwloc</code>. (These guys <a href="http://haskellstack.org" rel="nofollow">http://haskellstack.org</a> solved the same problem for Haskell.)</p> </li> <li> <p dir="auto">The error message is a mouthful. The package manager should be mature enough to give a clear error message and not dump a full stack trace from <code class="notranslate">libgit2</code> onto me; I don't care how <code class="notranslate">PkgDev</code> communicates with git servers.</p> </li> <li> <p dir="auto">Both <code class="notranslate">Pkg.status()</code> or <code class="notranslate">Pkg.update()</code> should complain as well. Since they don't it's difficult to debug this.</p> </li> <li> <p dir="auto">When I re-tried a few days later, <code class="notranslate">Pkg.update()</code> got stuck even worse since there were other upstream changes to <code class="notranslate">METADATA</code> in the mean time, and Julia told me to "resolve things manually". I did (<code class="notranslate">git checkout -- .</code> to overwrite all local uncommitted changes that shouldn't have been there in the first place, and then a <code class="notranslate">git pull --rebase</code>). Unfortunately, this just brought me back to the original problem.</p> </li> <li> <p dir="auto">There are no instructions for working around this. I would be happy to issue some manual git commands if Julia is getting too confused -- a pointer to instructions would be much appreciated. This page <a href="https://docs.julialang.org/en/stable/manual/packages/#package-development" rel="nofollow">https://docs.julialang.org/en/stable/manual/packages/#package-development</a> is already quite details; I think it should also list the errors people can receive, and how to resolve or work around them. In this case, pointing to instructions for manually cloning, pushing, and creating a pull request would be good. I think these instructions would be similar to those for package development proper, including creating a branch after the fact.</p> </li> </ol>
<p dir="auto">Ref <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="221519066" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/METADATA.jl/issues/8838" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/METADATA.jl/pull/8838/hovercard" href="https://github.com/JuliaLang/METADATA.jl/pull/8838">JuliaLang/METADATA.jl#8838</a></p>
1
<p dir="auto">Since constructor visibility <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="61017158" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/2341" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/2341/hovercard" href="https://github.com/microsoft/TypeScript/issues/2341">#2341</a> got merged. I haven't been able to utilise it fully because the classes I can benefit from requires type parameters and this typings on static methods.</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="abstract class Model&lt;P&gt; { static create(props: P): this { let model = window.store[this.name + props.id]; if (model) { return model; } return window.store[this.name + props.id] = new this(props) } protected constructor(props: P) { } }"><pre class="notranslate"><span class="pl-k">abstract</span> <span class="pl-k">class</span> <span class="pl-smi">Model</span><span class="pl-c1">&lt;</span><span class="pl-smi">P</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">static</span> <span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-s1">props</span>: <span class="pl-smi">P</span><span class="pl-kos">)</span>: this <span class="pl-kos">{</span> <span class="pl-k">let</span> <span class="pl-s1">model</span> <span class="pl-c1">=</span> <span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-c1">store</span><span class="pl-kos">[</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">+</span> <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">model</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">model</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">return</span> <span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-c1">store</span><span class="pl-kos">[</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">+</span> <span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">this</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-k">protected</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">props</span>: <span class="pl-smi">P</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">The <code class="notranslate">Model</code> class is a base class. A <code class="notranslate">this</code> typing would be very good to refer to the subclass instead of the base class. Since many classes has type arguments in their constructors, it makes sense to allow type arguments in static factory methods as well, otherwise you cannot create type safe factory methods.</p>
<p dir="auto">When trying to implement a fairly basic, but polymorphic, active record style model system we run into issues with the type system not respecting <code class="notranslate">this</code> when used in conjunction with a constructor or template/generic.</p> <p dir="auto">I've posted before about this here, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114630380" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/5493" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/5493/hovercard" href="https://github.com/microsoft/TypeScript/issues/5493">#5493</a>, and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114586216" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/5492" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/5492/hovercard" href="https://github.com/microsoft/TypeScript/issues/5492">#5492</a> appears to mention this behavior also.</p> <p dir="auto">And here is an SO post this that I made:<br> <a href="http://stackoverflow.com/questions/33443793/create-a-generic-factory-in-typescript-unsolved" rel="nofollow">http://stackoverflow.com/questions/33443793/create-a-generic-factory-in-typescript-unsolved</a></p> <p dir="auto">I have recycled my example from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114630380" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/5493" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/5493/hovercard" href="https://github.com/microsoft/TypeScript/issues/5493">#5493</a> into this ticket for further discussion. I wanted an open ticket representing the desire for such a thing and for discussion but the other two are closed.</p> <p dir="auto">Here is an example that outlines a model <code class="notranslate">Factory</code> which produces models. If you want to customize the <code class="notranslate">BaseModel</code> that comes back from the <code class="notranslate">Factory</code> you should be able to override it. However this fails because <code class="notranslate">this</code> cannot be used in a static member.</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Typically in a library export interface InstanceConstructor&lt;T extends BaseModel&gt; { new(fac: Factory&lt;T&gt;): T; } export class Factory&lt;T extends BaseModel&gt; { constructor(private cls: InstanceConstructor&lt;T&gt;) {} get() { return new this.cls(this); } } export class BaseModel { // NOTE: Does not work.... constructor(private fac: Factory&lt;this&gt;) {} refresh() { // get returns a new instance, but it should be of // type Model, not BaseModel. return this.fac.get(); } } // Application Code export class Model extends BaseModel { do() { return true; } } // Kinda sucks that Factory cannot infer the &quot;Model&quot; type let f = new Factory&lt;Model&gt;(Model); let a = f.get(); // b is inferred as any here. let b = a.refresh();"><pre class="notranslate"><span class="pl-c">// Typically in a library</span> <span class="pl-k">export</span> <span class="pl-k">interface</span> <span class="pl-smi">InstanceConstructor</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-k">extends</span> <span class="pl-smi">BaseModel</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">new</span><span class="pl-kos">(</span><span class="pl-s1">fac</span>: <span class="pl-smi">Factory</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span>: <span class="pl-smi">T</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Factory</span><span class="pl-c1">&lt;</span><span class="pl-smi">T</span> <span class="pl-k">extends</span> <span class="pl-smi">BaseModel</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">private</span> <span class="pl-s1">cls</span>: <span class="pl-smi">InstanceConstructor</span><span class="pl-kos">&lt;</span><span class="pl-smi">T</span><span class="pl-kos">&gt;</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">cls</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">BaseModel</span> <span class="pl-kos">{</span> <span class="pl-c">// NOTE: Does not work....</span> <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">private</span> <span class="pl-s1">fac</span>: <span class="pl-smi">Factory</span><span class="pl-kos">&lt;</span>this<span class="pl-kos">&gt;</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-en">refresh</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// get returns a new instance, but it should be of</span> <span class="pl-c">// type Model, not BaseModel.</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">fac</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// Application Code</span> <span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Model</span> <span class="pl-k">extends</span> <span class="pl-smi">BaseModel</span> <span class="pl-kos">{</span> <span class="pl-en">do</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// Kinda sucks that Factory cannot infer the "Model" type</span> <span class="pl-k">let</span> <span class="pl-s1">f</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Factory</span><span class="pl-kos">&lt;</span><span class="pl-smi">Model</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-smi">Model</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">let</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">f</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// b is inferred as any here.</span> <span class="pl-k">let</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">refresh</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">Maybe this issue is silly and there is an easy workaround. I welcome comments regarding how such a pattern can be achieved.</p>
1
<h2 dir="auto">Question</h2> <p dir="auto"><strong>For English only</strong>, other languages will not accept.</p> <p dir="auto">Before asking a question, make sure you have:</p> <ul dir="auto"> <li>Googled your question.</li> <li>Searched open and closed <a href="https://github.com/apache/shardingsphere/issues">GitHub issues</a>.</li> <li>Read documentation: <a href="https://shardingsphere.apache.org/document/current/en/overview" rel="nofollow">ShardingSphere Doc</a>.</li> </ul> <p dir="auto">Please pay attention on issues you submitted, because we maybe need more details.<br> If no response anymore and we cannot reproduce it on current information, we will <strong>close it</strong>.</p> <p dir="auto">version 4.1.1</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p> <h3 dir="auto">Which version of Sharding-Jdbc do you using?</h3> <p dir="auto">1.4.2<br> 目前可以显示下发到对应数据库执行的sql明细么?</p>
0
<p dir="auto">Hi Electron team,</p> <p dir="auto">A few days ago,we make a new issue about this,but the problem is not solved, you can see this issue:<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="652247947" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/24443" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/24443/hovercard" href="https://github.com/electron/electron/issues/24443">#24443</a></p> <p dir="auto">Recently, we have scanned both BoringSSL and Chromium, but both of them have no vulnerabilities .</p> <p dir="auto">so could you please help us .<br> Looking forward your soon feedback.</p> <p dir="auto">Thank you in advance.</p>
<ul dir="auto"> <li>Output of <code class="notranslate">node_modules/.bin/electron --version</code>: v2.0.11</li> <li>Operating System (Platform and Version): Arch Linux</li> </ul> <p dir="auto"><strong>Expected Behavior</strong><br> Menu bar text font color should be white for a black/dark background.</p> <p dir="auto"><strong>Actual behavior</strong><br> Menu bar text color is gray(close to black) with black background. So the text is unreadable.</p> <p dir="auto"><strong>To Reproduce</strong><br> Have had this problem since installation.</p> <p dir="auto"><strong>Screenshots</strong><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/21225957/47019620-265fee00-d175-11e8-979b-355265503a47.png"><img src="https://user-images.githubusercontent.com/21225957/47019620-265fee00-d175-11e8-979b-355265503a47.png" alt="atom" style="max-width: 100%;"></a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/21225957/47019622-265fee00-d175-11e8-947b-1d2260c7e04d.png"><img src="https://user-images.githubusercontent.com/21225957/47019622-265fee00-d175-11e8-947b-1d2260c7e04d.png" alt="code" style="max-width: 100%;"></a></p> <p dir="auto"><strong>Additional Information</strong><br> I am facing this problem on both Atom and VS Code so I am presuming it to be related to Electron. This is happening on both light and dark themes. In fact there is no change in the menu bar colors for Adapta and Adapta-Nokto themes. I have read abt this issue on another thread here but it was last updated an year ago and mentions the problem being related to electron not having GTK3 support. I presume this has been achieved so I dont know what to do now.</p>
0
<ul dir="auto"> <li>If <code class="notranslate">mode == 'w'</code> and <code class="notranslate">warn==True</code> then weird <code class="notranslate">raw_input</code> is requested. Change this to raise/warn as appropriate</li> <li>change the <code class="notranslate">_quiet</code> field (default is <code class="notranslate">False</code>) to a warning (about duplicates in readback)</li> </ul>
<p dir="auto">In <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="187096549" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14576" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/14576/hovercard" href="https://github.com/pandas-dev/pandas/pull/14576">#14576</a>, we consolidated compression code and introduced support for compressed URLs beyond just gzip. However, as described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="187096549" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/14576" data-hovercard-type="pull_request" data-hovercard-url="/pandas-dev/pandas/pull/14576/hovercard?comment_id=264963575&amp;comment_type=issue_comment" href="https://github.com/pandas-dev/pandas/pull/14576#issuecomment-264963575">#14576 (comment)</a>, the c-engine cannot read bz2-compressed URLs in python 2. This error is coming from <a href="https://github.com/pandas-dev/pandas/blob/b3dd9bafbfcbac1a2b6ab756e588d6e167f90439/pandas/parser.pyx#L615-L621"><code class="notranslate">parser.pyx#L615-L621</code></a>. There may be potential to entirely bypass this offending code as it appears to duplicate the functionality of <code class="notranslate">_get_handle</code>.</p>
0
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">I should be able to use the package <a href="https://github.com/request/request">request</a> without crashes.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">The server crashes when I import the package.<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11896398/34912646-ea691122-f8cd-11e7-9d90-d770a3240f84.png"><img src="https://user-images.githubusercontent.com/11896398/34912646-ea691122-f8cd-11e7-9d90-d770a3240f84.png" alt="image" style="max-width: 100%;"></a></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="These dependencies were not found: * fs in ./node_modules/needle/lib/needle.js, ./node_modules/needle/lib/multipart.js and 1 other * net in ./node_modules/forever-agent/index.js, ./node_modules/tough-cookie/lib/cookie.js and 1 other * tls in ./node_modules/forever-agent/index.js, ./node_modules/tunnel-agent/index.js To install them, you can run: npm install --save fs net tls"><pre class="notranslate"><code class="notranslate">These dependencies were not found: * fs in ./node_modules/needle/lib/needle.js, ./node_modules/needle/lib/multipart.js and 1 other * net in ./node_modules/forever-agent/index.js, ./node_modules/tough-cookie/lib/cookie.js and 1 other * tls in ./node_modules/forever-agent/index.js, ./node_modules/tunnel-agent/index.js To install them, you can run: npm install --save fs net tls </code></pre></div> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <ol dir="auto"> <li>Get a next.js project running (I've utilized the <a href="https://github.com/zeit/next.js/tree/canary/examples/basic-css">Basic CSS Exaple</a>)</li> <li>Add the package with <code class="notranslate">npm install request</code></li> <li>Import the package anywhere with <code class="notranslate">import request from 'request'</code></li> <li>Try to run, the server crashes as soon as it reaches the import.</li> </ol> <h2 dir="auto">Context</h2> <p dir="auto">I am just trying to create a POST request to an API.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>next</td> <td>v4.2.3</td> </tr> <tr> <td>node</td> <td>v8.1.3</td> </tr> <tr> <td>OS</td> <td>Ubuntu 16.04.3 LTS</td> </tr> <tr> <td>browser</td> <td>Chrome 62.0.3202.89</td> </tr> </tbody> </table>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <p dir="auto">I've been following the <a href="https://github.com/zeit/next.js/tree/master/examples/with-redux-saga">https://github.com/zeit/next.js/tree/master/examples/with-redux-saga</a> example and noticed when I change the code in the saga files, the app is hot-reloaded, although not the saga files. The new saga code starts working after F5 reload.</p> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">When saga files changed, the changes are propagated with the rest of the app and replaced the existing saga code.</p> <h2 dir="auto">Current Behavior</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="client.js?3cc2700:199 [HMR] bundle rebuilding client.js?3cc2700:207 [HMR] bundle rebuilt in 439ms process-update.js?3cc2700:27 [HMR] Checking for updates on the server... process-update.js?3cc2700:100 [HMR] Updated modules: process-update.js?3cc2700:102 [HMR] - ./saga.js process-update.js?3cc2700:102 [HMR] - ./store.js process-update.js?3cc2700:102 [HMR] - ./pages?entry process-update.js?3cc2700:107 [HMR] App is up to date."><pre class="notranslate"><code class="notranslate">client.js?3cc2700:199 [HMR] bundle rebuilding client.js?3cc2700:207 [HMR] bundle rebuilt in 439ms process-update.js?3cc2700:27 [HMR] Checking for updates on the server... process-update.js?3cc2700:100 [HMR] Updated modules: process-update.js?3cc2700:102 [HMR] - ./saga.js process-update.js?3cc2700:102 [HMR] - ./store.js process-update.js?3cc2700:102 [HMR] - ./pages?entry process-update.js?3cc2700:107 [HMR] App is up to date. </code></pre></div> <p dir="auto">But saga code is still the former one, until next server render.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <ol dir="auto"> <li>clone the with-redux-saga example</li> <li>Run with <code class="notranslate">next</code></li> <li>Add some changes, e.g. console.log at the saga beginning <a href="https://github.com/zeit/next.js/blob/master/examples/with-redux-saga/saga.js#L31">https://github.com/zeit/next.js/blob/master/examples/with-redux-saga/saga.js#L31</a></li> <li>save, watch the code replace, but not the saga.</li> </ol> <p dir="auto">Is this even possible? The saga file is executed after change, but the saga code in the generators does not.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>next</td> <td>v3.2.1</td> </tr> <tr> <td>node</td> <td>v5.12.0</td> </tr> <tr> <td>OS</td> <td>Windows 10 x64</td> </tr> <tr> <td>browser</td> <td>Google Chrome, Version 60.0.3112.113 (Official Build) (64-bit)</td> </tr> </tbody> </table>
0
<p dir="auto">Users who want a macro that expands to a collection items are required to wrap the RHS in <code class="notranslate">{}</code> in order to get them to expand to a whole block. However, if they fail to do so, they unexpectedly just get the first item of the block, rather than an error message.</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="macro_rules! print_if_nonzero( ($msg:expr, $($field:ident),*) =&gt; ( /*{*/ $( if t.$field != 0 { println($msg); } )* /*}*/ ) ) struct T { x: int, y: int } fn main() { let t = T { x: 0, y: 0 }; print_if_nonzero!(&quot;hello&quot;, x, y); }"><pre class="notranslate"><span class="pl-k">macro_rules!</span> print_if_nonzero<span class="pl-kos">(</span> <span class="pl-kos">(</span>$msg<span class="pl-kos">:</span>expr, $<span class="pl-kos">(</span>$field<span class="pl-kos">:</span>ident<span class="pl-kos">)</span>,<span class="pl-c1">*</span><span class="pl-kos">)</span> =&gt; <span class="pl-kos">(</span> <span class="pl-c">/*{*/</span> $<span class="pl-kos">(</span> <span class="pl-k">if</span> t.$field != <span class="pl-c1">0</span> <span class="pl-kos">{</span> println<span class="pl-kos">(</span>$msg<span class="pl-kos">)</span>; <span class="pl-kos">}</span> <span class="pl-kos">)</span><span class="pl-c1">*</span> <span class="pl-c">/*}*/</span> <span class="pl-kos">)</span> <span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-k">struct</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">y</span><span class="pl-kos">:</span> <span class="pl-smi">int</span> <span class="pl-kos">}</span> <span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> t = <span class="pl-smi">T</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span><span class="pl-kos">:</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">y</span><span class="pl-kos">:</span> <span class="pl-c1">0</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-en">print_if_nonzero</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"hello"</span>, x, y<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">...expands to...</p> <div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() { let t = T{x: 0, y: 0,}; if t.x != 0 { println(&quot;hello&quot;); }; }"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">let</span> t = <span class="pl-smi">T</span><span class="pl-kos">{</span><span class="pl-c1">x</span><span class="pl-kos">:</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">y</span><span class="pl-kos">:</span> <span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">if</span> t<span class="pl-kos">.</span><span class="pl-c1">x</span> != <span class="pl-c1">0</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-kos">(</span><span class="pl-s">"hello"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div>
<p dir="auto">When two items in the same documentation page have the same name, rustdoc generates duplicate HTML <code class="notranslate">id</code> attributes for them. This makes the HTML invalid, but more importantly, it makes it impossible to link to anything but the one that shows up first in the source.</p> <p dir="auto">For example, <a href="http://doc.rust-lang.org/nightly/std/vec/struct.Vec.html" rel="nofollow"><code class="notranslate">Vec</code>'s page</a> contains multiple impls of <code class="notranslate">IntoIterator</code>, and therefore multiple HTML elements that have an <code class="notranslate">id</code> attribute of <code class="notranslate">assoc_type.Item</code>, <code class="notranslate">assoc_type.IntoIter</code>, and <code class="notranslate">method.into_iter</code>.</p> <p dir="auto">This is not limited to impls of the same trait, as different traits (and inherent impls) could define methods or associated types with the same name.</p>
0
<h1 dir="auto">Security - tagging UserCheckerInterface</h1> <p dir="auto">When working with custom authentications, you most likely want to implement a custom UserChecker. The standard "form" supports this but doesn't really allow customization. "simple_form" does not have a standard implementation for this, sadly.</p> <h1 dir="auto">Proposal</h1> <p dir="auto">I came to the conclusion that it might be a lot easier to add some custom account/user validation. I was creating my own Authentication and user provider and stumbled against the choice to implement the Simple variant or the normal (older) variant.</p> <p dir="auto">One of the main reasons I couldn't implement the existing variant, was due to the lack of customization of the UserChecker. Before loading the user, I had to know if the user was supposed to see a captcha or if the IP of the user was blocked. Before the authentication, I wanted to know if the account had any blocks. After the authentication, I wanted to load a secondary Entity that I would check some additional account statuses. I could not work around this with existing code so had to write a custom provider for this.</p> <p dir="auto">A simple solution would be to allow the firewall options for a certain authentication method to allow passing the ID of a custom service. This would mean you'd get the following option:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="security: firewall: secured_area: (simple_)form: user_checker_service: my.user_checker"><pre class="notranslate"><span class="pl-ent">security</span>: <span class="pl-ent">firewall</span>: <span class="pl-ent">secured_area</span>: <span class="pl-ent">(simple_)form</span>: <span class="pl-ent">user_checker_service</span>: <span class="pl-s">my.user_checker</span></pre></div> <p dir="auto">As long as your service would implement the UserChecker Interface, this would all be possible. However, this isn't really flexible... You could do the following:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="security: firewall: secured_area: (simple_)form: user_checkers: - my.user_checker.ip_block - my.user_checker.captcha_block - my.user_checker.banned_account - my.user_checker.accepts_latest_eula - vendor.bundle.extra_user_check"><pre class="notranslate"><span class="pl-ent">security</span>: <span class="pl-ent">firewall</span>: <span class="pl-ent">secured_area</span>: <span class="pl-ent">(simple_)form</span>: <span class="pl-ent">user_checkers</span>: - <span class="pl-s">my.user_checker.ip_block</span> - <span class="pl-s">my.user_checker.captcha_block</span> - <span class="pl-s">my.user_checker.banned_account</span> - <span class="pl-s">my.user_checker.accepts_latest_eula</span> - <span class="pl-s">vendor.bundle.extra_user_check</span></pre></div> <p dir="auto">With this solution, you would be able to add extra checks on demand. It would be a really nice addition to work with the Simple provider as well, but that would introduce BC breaks, but solve a lot of nasty code.</p> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyBannedAccountUserChecker implements PreUserLoadCheckerInterface, PreAuthUserCheckerInterface, PostAuthUserCheckerInterface { public function checkPreUserLoad() { // additional checks BEFORE the user is being load... // good example is to check IP block, captcha's, other requirements } public function checkPreAuth(UserInterface $user) { if (!$user instanceof MyUser) { return; } // .. get the entity where ever you store if the user is banned if ($banned) { throw new AccountBannedException($user); // extends AuthenticationException } } public function checkPostAuth(UserInterface $user) { ... } }"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyBannedAccountUserChecker</span> <span class="pl-k">implements</span> <span class="pl-v">PreUserLoadCheckerInterface</span>, <span class="pl-v">PreAuthUserCheckerInterface</span>, <span class="pl-v">PostAuthUserCheckerInterface</span> { <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">checkPreUserLoad</span>() { <span class="pl-c">// additional checks BEFORE the user is being load...</span> <span class="pl-c">// good example is to check IP block, captcha's, other requirements</span> } <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">checkPreAuth</span>(<span class="pl-smi"><span class="pl-smi">UserInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>user</span>) { <span class="pl-k">if</span> (!<span class="pl-s1"><span class="pl-c1">$</span>user</span> instanceof <span class="pl-v">MyUser</span>) { <span class="pl-k">return</span>; } <span class="pl-c">// .. get the entity where ever you store if the user is banned</span> <span class="pl-k">if</span> (<span class="pl-s1"><span class="pl-c1">$</span>banned</span>) { <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">AccountBannedException</span>(<span class="pl-s1"><span class="pl-c1">$</span>user</span>); <span class="pl-c">// extends AuthenticationException</span> } } <span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">checkPostAuth</span>(<span class="pl-smi"><span class="pl-smi">UserInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>user</span>) { <span class="pl-c1">.</span>.<span class="pl-c1">.</span> } }</pre></div> <p dir="auto">I think this example should demonstrate exactly what I mean. This will give you flexibility while it will also make it easier to configure the security component user checks. I have noticed examples of people who are totally lost in this component and have no clue where to add the custom checks for this. As far as I know it's only possible to modify the current existing UserChecker by a CompilerPass. It's tightly coupled with the "form" login method and the only available implementation works only with the AdvancedUserInterface (which imo should be rm -rf'd).</p> <p dir="auto">To prevent backwards incompatibility issues, the current UserCheckerInterface should not be removed, although the splitting of pre and post auth checks can cause a minor inconvenience.</p>
<p dir="auto">Hi everyone, I'm working on a fresh Symfony 2.0.8 project.</p> <p dir="auto">UniqueEntity constraint seem to being not working. I'm using yml validation file:</p> <div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="NicaStaff\IQCoreBundle\Entity\User: constraints: - \Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: { fields: email, message: This email is already used } properties: first_name: - NotBlank: { groups: [default] }"><pre class="notranslate"><span class="pl-v">NicaStaff</span>\<span class="pl-v">IQCoreBundle</span>\<span class="pl-v">Entity</span>\<span class="pl-v">User</span>: constraints: - \<span class="pl-v">Symfony</span>\<span class="pl-v">Bridge</span>\<span class="pl-v">Doctrine</span>\<span class="pl-v">Validator</span>\<span class="pl-v">Constraints</span>\<span class="pl-v">UniqueEntity</span>: { fields: email, message: <span class="pl-v">This</span> email is already used } properties: first_name: - <span class="pl-v">NotBlank</span>: { groups: [default] }</pre></div> <p dir="auto">The assertion is being skipped, so I got a MySQL duplicated entry error.</p> <p dir="auto">In the doctrine mapping 'email' is unique and string(255) (Hopefully this has nothing to do with the issue).</p> <p dir="auto">Following the stack and messing up with files and code I found that UniqueEntity Constraint is being executed but the validatedBy() method is not being overrided.</p> <p dir="auto">In the other hand, UniqueEntityValidator is never being executed.</p> <p dir="auto">As opposite, a working Symfony 2.0.5 previous project the UniqueEntity assert is working like a charm. If I mess up with the sames files it is clear that UniqueEntityValidator is being executed and the UniqueEntity::validatedBy() is being correctly override.</p> <p dir="auto">Any workaround for this? Did I miss something?</p> <p dir="auto">Regards.</p>
0
<p dir="auto">I want to perform on the GPU non-maximum-suppression on the output of a darknet/yolo CNN.<br> The following testing code works fine :</p> <p dir="auto">//Credits: adapted from <a href="https://github.com/pprp">https://github.com/pprp</a> to test nms parallel algo with at::Tensor as input<br> #include &lt;stdio.h&gt;<br> #include &lt;stdlib.h&gt;<br> #include "string"<br> //#include &lt;windows.h&gt;//needed for LoadLibrary<br> #include &lt;cuda_runtime.h&gt;<br> #include <br> #include &lt;opencv2/core/core.hpp&gt;<br> #include &lt;opencv2/highgui/highgui.hpp&gt;<br> #include "opencv2/imgproc/imgproc.hpp"<br> #include "device_launch_parameters.h"</p> <p dir="auto">#include "device_functions.h"</p> <p dir="auto">#include &lt;ATen/ATen.h&gt;<br> #include &lt;ATen/cuda/CUDAContext.h&gt;<br> #include &lt;THC/THC.h&gt;<br> #include &lt;THC/THCDeviceUtils.cuh&gt;</p> <p dir="auto">#include "torch/torch.h"//-&gt;including torch gives problems!!!???</p> <p dir="auto">using namespace std;</p> <p dir="auto">#define HANDLE_ERROR(ans) { gpuAssert((ans), <strong>FILE</strong>, <strong>LINE</strong>); }</p> <p dir="auto">inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true)<br> {<br> if (code != cudaSuccess)<br> {<br> fprintf(stderr,"GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);<br> if (abort) exit(code);<br> }<br> }</p> <p dir="auto">typedef struct<br> {<br> double x,y,w,h;<br> char s[100];<br> char cls[100];<br> double cmps;<br> }box;</p> <p dir="auto"><strong>device</strong> inline float devIoU(float const* const b1, float const* const b2) {<br> float ai = (float)(b1[2] + 1) * (b1[3] + 1);<br> float aj = (float)(b2[2] + 1) * (b2[3] + 1);<br> float x_inter, x2_inter, y_inter, y2_inter;</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="x_inter = max(b1[0], b2[0]); y_inter = max(b1[1], b2[1]); x2_inter = min((b1[0] + b1[2]), (b2[0] + b2[2])); y2_inter = min((b1[1] + b1[3]), (b2[1] + b2[3])); float w = (float)max((float)0, x2_inter - x_inter); float h = (float)max((float)0, y2_inter - y_inter); float inter = ((w * h) / (ai + aj - w * h)); return inter;"><pre class="notranslate"><code class="notranslate">x_inter = max(b1[0], b2[0]); y_inter = max(b1[1], b2[1]); x2_inter = min((b1[0] + b1[2]), (b2[0] + b2[2])); y2_inter = min((b1[1] + b1[3]), (b2[1] + b2[3])); float w = (float)max((float)0, x2_inter - x_inter); float h = (float)max((float)0, y2_inter - y_inter); float inter = ((w * h) / (ai + aj - w * h)); return inter; </code></pre></div> <p dir="auto">}</p> <p dir="auto"><strong>global</strong> void NMS_GPU(const int n_boxes, const float nms_overlap_thresh,<br> const float* dev_boxes, bool* d_res) {<br> unsigned int xIndex = blockIdx.x * blockDim.x + threadIdx.x;<br> //unsigned int xIndex = threadIdx.x;//only 1 block with index 0!<br> float cur_box[5];<br> float a_box[5];<br> cur_box[0] = dev_boxes[xIndex * 5 + 0];<br> cur_box[1] = dev_boxes[xIndex * 5 + 1];<br> cur_box[2] = dev_boxes[xIndex * 5 + 2];<br> cur_box[3] = dev_boxes[xIndex * 5 + 3];<br> cur_box[4] = dev_boxes[xIndex * 5 + 4];<br> //__syncthreads();//not necessary as cur_box is not a shared resource<br> for (int i = 0; i &lt; 19; i++)<br> {<br> if (i != xIndex)<br> {<br> a_box[0] = dev_boxes[i * 5 + 0];<br> a_box[1] = dev_boxes[i * 5 + 1];<br> a_box[2] = dev_boxes[i * 5 + 2];<br> a_box[3] = dev_boxes[i * 5 + 3];<br> a_box[4] = dev_boxes[i * 5 + 4];<br> if (a_box[4] &lt; cur_box[4] )<br> {<br> if (devIoU(a_box, cur_box) &gt; nms_overlap_thresh)<br> {<br> d_res[i] = false;<br> }<br> }<br> }<br> }<br> }</p> <p dir="auto">int main()<br> {<br> int const threadsPerBlock = sizeof(unsigned long long) * 8;//Bufo : =64(float size)<br> //LoadLibrary(TEXT("D:\dev\Cpp\dependencies\torchnew\lib\torch_cuda.dll"));<br> at::DeviceType device_type;</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (at::cuda::is_available()) { device_type = at::kCUDA; } else { device_type = at::kCPU; std::cout &lt;&lt; &quot;No GPU avalaible, sorry ...&quot; &lt;&lt; std::endl; return 0; } at::Device device(device_type); std::cout &lt;&lt; &quot;Device : &quot; &lt;&lt; device_type &lt;&lt; std::endl; const int count = 19; cv::Mat temp = cv::imread(&quot;Cow_45.jpg&quot;,1); bool *h_res =(bool*)malloc(sizeof(bool)*count);//contains the result of the nms algo (cpu context) for(int i=0; i&lt;count; i++) { h_res[i] = true; } box b[count]; b[0].x = 996.000000;b[0].y = 2566.420000;b[0].w = 170.793000;b[0].h=172.580000; strcpy(b[0].cls,&quot;nose&quot;);strcpy(b[0].s,&quot;0.983194&quot;);b[0].cmps=0.983194; b[1].x = 4238.937000;b[1].y = 1594.513000;b[1].w = 160.063000;b[1].h=148.487000; strcpy(b[1].cls,&quot;eye&quot;);strcpy(b[1].s,&quot;0.992166&quot;);b[1].cmps=0.992166; b[2].x = 4656.389000;b[2].y = 2175.186000;b[2].w = 316.180000;b[2].h=221.552000; strcpy(b[2].cls,&quot;nose&quot;);strcpy(b[2].s,&quot;0.994816&quot;);b[2].cmps=0.994816; b[3].x = 4316.000000;b[3].y = 1660.000000;b[3].w = 127.474000;b[3].h=113.452000; strcpy(b[3].cls,&quot;eye&quot;);strcpy(b[3].s,&quot;0.990833&quot;);b[3].cmps=0.990833; b[4].x = 997.013000;b[4].y = 2664.408000;b[4].w = 222.214000;b[4].h=229.068000; strcpy(b[4].cls,&quot;nose&quot;);strcpy(b[4].s,&quot;0.985067&quot;);b[4].cmps=0.985067; b[5].x = 666.069000;b[5].y = 2029.219000;b[5].w = 135.689000;b[5].h=160.833000; strcpy(b[5].cls,&quot;eye&quot;);strcpy(b[5].s,&quot;0.993240&quot;);b[5].cmps=0.993240; b[6].x = 4653.547000;b[6].y = 2324.000000;b[6].w = 338.125000;b[6].h=133.902000; strcpy(b[6].cls,&quot;nose&quot;);strcpy(b[6].s,&quot;0.982858&quot;);b[6].cmps=0.982858; b[7].x = 4476.556000;b[7].y = 2131.557000;b[7].w = 253.402000;b[7].h=273.601000; strcpy(b[7].cls,&quot;nose&quot;);strcpy(b[7].s,&quot;0.959098&quot;);b[7].cmps=0.959098; b[8].x = 754.326000;b[8].y = 2571.066000;b[8].w = 324.674000;b[8].h=161.605000; strcpy(b[8].cls,&quot;nose&quot;);strcpy(b[8].s,&quot;0.993699&quot;);b[8].cmps=0.993699; b[9].x = 729.962000;b[9].y = 2658.741000;b[9].w = 349.038000;b[9].h=192.046000; strcpy(b[9].cls,&quot;nose&quot;);strcpy(b[9].s,&quot;0.986209&quot;);b[9].cmps=0.986209; b[10].x = 1271.863000;b[10].y = 2058.679000;b[10].w = 138.781000;b[10].h=137.553000; strcpy(b[10].cls,&quot;eye&quot;);strcpy(b[10].s,&quot;0.989965&quot;);b[10].cmps=0.989965; b[11].x = 4316.000000;b[11].y = 1601.751000;b[11].w = 134.204000;b[11].h=141.249000; strcpy(b[11].cls,&quot;eye&quot;);strcpy(b[11].s,&quot;0.988307&quot;);b[11].cmps=0.988307; b[12].x = 650.901000;b[12].y = 2032.621000;b[12].w = 91.484000;b[12].h=42.112000; strcpy(b[12].cls,&quot;eye&quot;);strcpy(b[12].s,&quot;0.969982&quot;);b[12].cmps=0.969982; b[13].x = 1328.000000;b[13].y = 2058.692000;b[13].w = 103.849000;b[13].h=136.518000; strcpy(b[13].cls,&quot;eye&quot;);strcpy(b[13].s,&quot;0.987316&quot;);b[13].cmps=0.987316; b[14].x = 214.809000;b[14].y = 1599.809000;b[14].w = 1553.705000;b[14].h=1319.679000; strcpy(b[14].cls,&quot;head&quot;);strcpy(b[14].s,&quot;0.997623&quot;);b[14].cmps=0.997623; b[15].x = 3826.177000;b[15].y = 1072.206000;b[15].w = 1254.063000;b[15].h=1412.903000; strcpy(b[15].cls,&quot;head&quot;);strcpy(b[15].s,&quot;0.997487&quot;);b[15].cmps=0.997487; b[16].x = 729.632000;b[16].y = 2578.523000;b[16].w = 442.495000;b[16].h=302.378000; strcpy(b[16].cls,&quot;nose&quot;);strcpy(b[16].s,&quot;0.960093&quot;);b[16].cmps=0.960093; b[17].x = 655.430000;b[17].y = 2031.151000;b[17].w = 91.570000;b[17].h=148.691000; strcpy(b[17].cls,&quot;eye&quot;);strcpy(b[17].s,&quot;0.993275&quot;);b[17].cmps=0.993275; b[18].x = 4251.712000;b[18].y = 1660.000000;b[18].w = 147.288000;b[18].h=105.309000; strcpy(b[18].cls,&quot;eye&quot;);strcpy(b[18].s,&quot;0.992576&quot;);b[18].cmps=0.992576; //*************************************************************************************************************************************** //copy boxes to a at::tensor at::Tensor boxes = at::zeros({ count,5 }); for (int i = 0; i &lt; count; i++) { boxes[i][0] = b[i].x; boxes[i][1] = b[i].y; boxes[i][2] = b[i].w; boxes[i][3] = b[i].h; boxes[i][4] = b[i].cmps; } boxes = boxes.to(device); float* boxes_as_array = boxes.data&lt;float&gt;();//convert at::tensor to a flat array float nms_overlap_thresh = 0.1; //Comment: this piece of code is apparently necessary to assign the Torch cuda context to the global cuda context THCState* state = at::globalContext().lazyInitCUDA(); // TODO replace with getTHCState const int col_blocks = THCCeilDiv(count, threadsPerBlock); unsigned long long* mask_dev = NULL; mask_dev = (unsigned long long*) THCudaMalloc(state,count * col_blocks * sizeof(unsigned long long)); //------------------------------------------------------------------------------------------------------------- bool *d_res; //port h_res to GPU HANDLE_ERROR(cudaMalloc((void**)&amp;d_res, count*sizeof(bool))); HANDLE_ERROR(cudaMemcpy(d_res, h_res,sizeof(bool)*count, cudaMemcpyHostToDevice)); NMS_GPU&lt;&lt;&lt;dim3(1,count,1),count&gt;&gt;&gt;(count,nms_overlap_thresh, boxes_as_array,d_res); //port d_res to CPU HANDLE_ERROR(cudaMemcpy(h_res, d_res, sizeof(bool)*count, cudaMemcpyDeviceToHost)); //display result for(int i =0; i&lt;count ; i++) { if(*(h_res+i) == true) { //printf(&quot;GPU Draw: %d--%d\n&quot;,i,*(h_res+i)); cv::putText(temp,b[i].cls,cv::Point((int)b[i].x,(int)b[i].y-5),cv::FONT_HERSHEY_SIMPLEX,1.7,cv::Scalar(255,255,255),5,8,0); cv::putText(temp,b[i].s,cv::Point((int)b[i].x+120,(int)b[i].y-5),cv::FONT_HERSHEY_SIMPLEX,1.7,cv::Scalar(255,255,255),5,8,0); cv::rectangle(temp,cv::Point((int)b[i].x,(int)b[i].y),cv::Point((int)b[i].x + (int)b[i].w,(int)b[i].y + (int)b[i].h),cv::Scalar(92.185,194),8,8,0); } } cv::namedWindow(&quot;Window&quot;,0); cv::resizeWindow(&quot;Window&quot;,1064,800); cv::imshow(&quot;Window&quot;,temp); cv::waitKey(0); return 0;"><pre class="notranslate"><code class="notranslate">if (at::cuda::is_available()) { device_type = at::kCUDA; } else { device_type = at::kCPU; std::cout &lt;&lt; "No GPU avalaible, sorry ..." &lt;&lt; std::endl; return 0; } at::Device device(device_type); std::cout &lt;&lt; "Device : " &lt;&lt; device_type &lt;&lt; std::endl; const int count = 19; cv::Mat temp = cv::imread("Cow_45.jpg",1); bool *h_res =(bool*)malloc(sizeof(bool)*count);//contains the result of the nms algo (cpu context) for(int i=0; i&lt;count; i++) { h_res[i] = true; } box b[count]; b[0].x = 996.000000;b[0].y = 2566.420000;b[0].w = 170.793000;b[0].h=172.580000; strcpy(b[0].cls,"nose");strcpy(b[0].s,"0.983194");b[0].cmps=0.983194; b[1].x = 4238.937000;b[1].y = 1594.513000;b[1].w = 160.063000;b[1].h=148.487000; strcpy(b[1].cls,"eye");strcpy(b[1].s,"0.992166");b[1].cmps=0.992166; b[2].x = 4656.389000;b[2].y = 2175.186000;b[2].w = 316.180000;b[2].h=221.552000; strcpy(b[2].cls,"nose");strcpy(b[2].s,"0.994816");b[2].cmps=0.994816; b[3].x = 4316.000000;b[3].y = 1660.000000;b[3].w = 127.474000;b[3].h=113.452000; strcpy(b[3].cls,"eye");strcpy(b[3].s,"0.990833");b[3].cmps=0.990833; b[4].x = 997.013000;b[4].y = 2664.408000;b[4].w = 222.214000;b[4].h=229.068000; strcpy(b[4].cls,"nose");strcpy(b[4].s,"0.985067");b[4].cmps=0.985067; b[5].x = 666.069000;b[5].y = 2029.219000;b[5].w = 135.689000;b[5].h=160.833000; strcpy(b[5].cls,"eye");strcpy(b[5].s,"0.993240");b[5].cmps=0.993240; b[6].x = 4653.547000;b[6].y = 2324.000000;b[6].w = 338.125000;b[6].h=133.902000; strcpy(b[6].cls,"nose");strcpy(b[6].s,"0.982858");b[6].cmps=0.982858; b[7].x = 4476.556000;b[7].y = 2131.557000;b[7].w = 253.402000;b[7].h=273.601000; strcpy(b[7].cls,"nose");strcpy(b[7].s,"0.959098");b[7].cmps=0.959098; b[8].x = 754.326000;b[8].y = 2571.066000;b[8].w = 324.674000;b[8].h=161.605000; strcpy(b[8].cls,"nose");strcpy(b[8].s,"0.993699");b[8].cmps=0.993699; b[9].x = 729.962000;b[9].y = 2658.741000;b[9].w = 349.038000;b[9].h=192.046000; strcpy(b[9].cls,"nose");strcpy(b[9].s,"0.986209");b[9].cmps=0.986209; b[10].x = 1271.863000;b[10].y = 2058.679000;b[10].w = 138.781000;b[10].h=137.553000; strcpy(b[10].cls,"eye");strcpy(b[10].s,"0.989965");b[10].cmps=0.989965; b[11].x = 4316.000000;b[11].y = 1601.751000;b[11].w = 134.204000;b[11].h=141.249000; strcpy(b[11].cls,"eye");strcpy(b[11].s,"0.988307");b[11].cmps=0.988307; b[12].x = 650.901000;b[12].y = 2032.621000;b[12].w = 91.484000;b[12].h=42.112000; strcpy(b[12].cls,"eye");strcpy(b[12].s,"0.969982");b[12].cmps=0.969982; b[13].x = 1328.000000;b[13].y = 2058.692000;b[13].w = 103.849000;b[13].h=136.518000; strcpy(b[13].cls,"eye");strcpy(b[13].s,"0.987316");b[13].cmps=0.987316; b[14].x = 214.809000;b[14].y = 1599.809000;b[14].w = 1553.705000;b[14].h=1319.679000; strcpy(b[14].cls,"head");strcpy(b[14].s,"0.997623");b[14].cmps=0.997623; b[15].x = 3826.177000;b[15].y = 1072.206000;b[15].w = 1254.063000;b[15].h=1412.903000; strcpy(b[15].cls,"head");strcpy(b[15].s,"0.997487");b[15].cmps=0.997487; b[16].x = 729.632000;b[16].y = 2578.523000;b[16].w = 442.495000;b[16].h=302.378000; strcpy(b[16].cls,"nose");strcpy(b[16].s,"0.960093");b[16].cmps=0.960093; b[17].x = 655.430000;b[17].y = 2031.151000;b[17].w = 91.570000;b[17].h=148.691000; strcpy(b[17].cls,"eye");strcpy(b[17].s,"0.993275");b[17].cmps=0.993275; b[18].x = 4251.712000;b[18].y = 1660.000000;b[18].w = 147.288000;b[18].h=105.309000; strcpy(b[18].cls,"eye");strcpy(b[18].s,"0.992576");b[18].cmps=0.992576; //*************************************************************************************************************************************** //copy boxes to a at::tensor at::Tensor boxes = at::zeros({ count,5 }); for (int i = 0; i &lt; count; i++) { boxes[i][0] = b[i].x; boxes[i][1] = b[i].y; boxes[i][2] = b[i].w; boxes[i][3] = b[i].h; boxes[i][4] = b[i].cmps; } boxes = boxes.to(device); float* boxes_as_array = boxes.data&lt;float&gt;();//convert at::tensor to a flat array float nms_overlap_thresh = 0.1; //Comment: this piece of code is apparently necessary to assign the Torch cuda context to the global cuda context THCState* state = at::globalContext().lazyInitCUDA(); // TODO replace with getTHCState const int col_blocks = THCCeilDiv(count, threadsPerBlock); unsigned long long* mask_dev = NULL; mask_dev = (unsigned long long*) THCudaMalloc(state,count * col_blocks * sizeof(unsigned long long)); //------------------------------------------------------------------------------------------------------------- bool *d_res; //port h_res to GPU HANDLE_ERROR(cudaMalloc((void**)&amp;d_res, count*sizeof(bool))); HANDLE_ERROR(cudaMemcpy(d_res, h_res,sizeof(bool)*count, cudaMemcpyHostToDevice)); NMS_GPU&lt;&lt;&lt;dim3(1,count,1),count&gt;&gt;&gt;(count,nms_overlap_thresh, boxes_as_array,d_res); //port d_res to CPU HANDLE_ERROR(cudaMemcpy(h_res, d_res, sizeof(bool)*count, cudaMemcpyDeviceToHost)); //display result for(int i =0; i&lt;count ; i++) { if(*(h_res+i) == true) { //printf("GPU Draw: %d--%d\n",i,*(h_res+i)); cv::putText(temp,b[i].cls,cv::Point((int)b[i].x,(int)b[i].y-5),cv::FONT_HERSHEY_SIMPLEX,1.7,cv::Scalar(255,255,255),5,8,0); cv::putText(temp,b[i].s,cv::Point((int)b[i].x+120,(int)b[i].y-5),cv::FONT_HERSHEY_SIMPLEX,1.7,cv::Scalar(255,255,255),5,8,0); cv::rectangle(temp,cv::Point((int)b[i].x,(int)b[i].y),cv::Point((int)b[i].x + (int)b[i].w,(int)b[i].y + (int)b[i].h),cv::Scalar(92.185,194),8,8,0); } } cv::namedWindow("Window",0); cv::resizeWindow("Window",1064,800); cv::imshow("Window",temp); cv::waitKey(0); return 0; </code></pre></div> <p dir="auto">}</p> <p dir="auto">Problem : When I include "torch/torch.h" (uncomment line 23) - something I need for rest of the project - I get the following error (Visual Studio 2019):</p> <p dir="auto">"Error member "torch::jit::detail::ParameterPolicy::all_slots" may not be initialized acudaNMSTEST D:\dev\Cpp\dependencies\torchnew\include\torch\csrc\jit\api\module.h 490 "</p> <p dir="auto">I struggled a couple of days to find a solution, but in vain. Any idea what is going on/what I did wrong?</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/malfet/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/malfet">@malfet</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/yf225/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/yf225">@yf225</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/glaringlee/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/glaringlee">@glaringlee</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/peterjc123/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/peterjc123">@peterjc123</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nbcsm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nbcsm">@nbcsm</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/guyang3532/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/guyang3532">@guyang3532</a></p>
<p dir="auto">win10 64 ,libtorch 1.5 release<br> I tried to run the <code class="notranslate">psroiales.cu</code> file to report an error.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="member of &quot;the torch: : jit: : detail: : AttributePolicy: : all_slots&quot; may not be initialized member &quot;torch::jit::detail::BufferPolicy::all_slots&quot; may not be initialized member &quot;torch::jit::detail::ModulePolicy::all_slots&quot; may not be initialized member &quot;torch::jit::detail::ParameterPolicy::all_slots&quot; may not be initialized D:\deeplearning\deeplearning\learn\libtorch\include\torch\csrc\jit\api\module.h 501 错误 MSB3721 命令“&quot;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe&quot; --use-local-env -ccbin &quot;D:\vs2019\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64&quot; -x cu -I&quot;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include&quot; -I&quot;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include&quot; --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -DNDEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler &quot;/EHsc /W3 /nologo /O2 /FdD:\deeplearning\x64\Release\dir\vc142.pdb /FS /Zi /MD /GR&quot; -o D:\deeplearning\x64\Release\dir\PSROIAlign_cuda.cu.obj &quot;D:\deeplearning\deeplearning\PSROIAlign_cuda.cu&quot;”已退出,返回代码为 1。 deeplearning D:\vs2019\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.2.targets 764 "><pre class="notranslate"><code class="notranslate">member of "the torch: : jit: : detail: : AttributePolicy: : all_slots" may not be initialized member "torch::jit::detail::BufferPolicy::all_slots" may not be initialized member "torch::jit::detail::ModulePolicy::all_slots" may not be initialized member "torch::jit::detail::ParameterPolicy::all_slots" may not be initialized D:\deeplearning\deeplearning\learn\libtorch\include\torch\csrc\jit\api\module.h 501 错误 MSB3721 命令“"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" --use-local-env -ccbin "D:\vs2019\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -DNDEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /O2 /FdD:\deeplearning\x64\Release\dir\vc142.pdb /FS /Zi /MD /GR" -o D:\deeplearning\x64\Release\dir\PSROIAlign_cuda.cu.obj "D:\deeplearning\deeplearning\PSROIAlign_cuda.cu"”已退出,返回代码为 1。 deeplearning D:\vs2019\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.2.targets 764 </code></pre></div> <details> <summary>PSROIAlign_cuda.cu</summary> <div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include &lt;ATen/cuda/CUDAApplyUtils.cuh&gt; #include &quot;PSROIAlign_cuda.h&quot; template &lt;typename T&gt; __device__ T bilinear_interpolate( const T* input, const int height, const int width, T y, T x, const int index /* index for debug only*/) { // deal with cases that inverse elements are out of feature map boundary if (y &lt; -1.0 || y &gt; height || x &lt; -1.0 || x &gt; width) { // empty return 0; } if (y &lt;= 0) y = 0; if (x &lt;= 0) x = 0; int y_low = (int)y; int x_low = (int)x; int y_high; int x_high; if (y_low &gt;= height - 1) { y_high = y_low = height - 1; y = (T)y_low; } else { y_high = y_low + 1; } if (x_low &gt;= width - 1) { x_high = x_low = width - 1; x = (T)x_low; } else { x_high = x_low + 1; } T ly = y - y_low; T lx = x - x_low; T hy = 1. - ly, hx = 1. - lx; // do bilinear interpolation T v1 = input[y_low * width + x_low]; T v2 = input[y_low * width + x_high]; T v3 = input[y_high * width + x_low]; T v4 = input[y_high * width + x_high]; T w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx; T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4); return val; } template &lt;typename T&gt; __global__ void PSROIAlignForwardCUDA( const int nthreads, const T* input, const T spatial_scale, const int channels, const int height, const int width, const int pooled_height, const int pooled_width, const int sampling_ratio, const T* rois, const int channels_out, T* output, int* channel_mapping) { CUDA_1D_KERNEL_LOOP(index, nthreads) { // (n, c_out, ph, pw) is an element in the pooled output int pw = index % pooled_width; int ph = (index / pooled_width) % pooled_height; int c_out = (index / pooled_width / pooled_height) % channels_out; int n = index / pooled_width / pooled_height / channels_out; // (n, c_in, ph, pw) is the associated element in the input int c_in = (c_out * pooled_height + ph) * pooled_width + pw; // [start, end) interval for spatial sampling const T* offset_rois = rois + n * 5; int roi_batch_ind = offset_rois[0]; // Do not using rounding; this implementation detail is critical T roi_start_w = offset_rois[1] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_start_h = offset_rois[2] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_w = offset_rois[3] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_h = offset_rois[4] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_width = roi_end_w - roi_start_w; T roi_height = roi_end_h - roi_start_h; T bin_size_h = static_cast&lt;T&gt;(roi_height) / static_cast&lt;T&gt;(pooled_height); T bin_size_w = static_cast&lt;T&gt;(roi_width) / static_cast&lt;T&gt;(pooled_width); // Do not using floor/ceil; this implementation detail is critical T hstart = static_cast&lt;T&gt;(ph) * bin_size_h + roi_start_h; T wstart = static_cast&lt;T&gt;(pw) * bin_size_w + roi_start_w; // We use roi_bin_grid to sample the grid and mimic integral int roi_bin_grid_h = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_height / pooled_height); int roi_bin_grid_w = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_width / pooled_width); const T count = roi_bin_grid_h * roi_bin_grid_w; const T* offset_input = input + (roi_batch_ind * channels + c_in) * height * width; T out_sum = 0; for (int iy = 0; iy &lt; roi_bin_grid_h; iy++) { const T y = hstart + static_cast&lt;T&gt;(iy + .5f) * bin_size_h / static_cast&lt;T&gt;(roi_bin_grid_h); for (int ix = 0; ix &lt; roi_bin_grid_w; ix++) { const T x = wstart + static_cast&lt;T&gt;(ix + .5f) * bin_size_w / static_cast&lt;T&gt;(roi_bin_grid_w); T val = bilinear_interpolate(offset_input, height, width, y, x, index); out_sum += val; } } out_sum /= count; output[index] = out_sum; channel_mapping[index] = c_in; } } template &lt;typename T&gt; __device__ void bilinear_interpolate_gradient( const int height, const int width, T y, T x, T&amp; w1, T&amp; w2, T&amp; w3, T&amp; w4, int&amp; x_low, int&amp; x_high, int&amp; y_low, int&amp; y_high, const int index /* index for debug only*/) { // deal with cases that inverse elements are out of feature map boundary if (y &lt; -1.0 || y &gt; height || x &lt; -1.0 || x &gt; width) { // empty w1 = w2 = w3 = w4 = 0.; x_low = x_high = y_low = y_high = -1; return; } if (y &lt;= 0) y = 0; if (x &lt;= 0) x = 0; y_low = (int)y; x_low = (int)x; if (y_low &gt;= height - 1) { y_high = y_low = height - 1; y = (T)y_low; } else { y_high = y_low + 1; } if (x_low &gt;= width - 1) { x_high = x_low = width - 1; x = (T)x_low; } else { x_high = x_low + 1; } T ly = y - y_low; T lx = x - x_low; T hy = 1. - ly, hx = 1. - lx; // reference in forward // T v1 = input[y_low * width + x_low]; // T v2 = input[y_low * width + x_high]; // T v3 = input[y_high * width + x_low]; // T v4 = input[y_high * width + x_high]; // T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4); w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx; return; } template &lt;typename T&gt; __global__ void PSROIAlignBackwardCUDA( const int nthreads, const T* grad_output, const int* channel_mapping, const int num_rois, const T spatial_scale, const int channels, const int height, const int width, const int pooled_height, const int pooled_width, const int sampling_ratio, const int channels_out, T* grad_input, const T* rois) { CUDA_1D_KERNEL_LOOP(index, nthreads) { // (n, *, ph, pw) is an element in the pooled output int pw = index % pooled_width; int ph = (index / pooled_width) % pooled_height; int n = index / pooled_width / pooled_height / channels_out; const T* offset_rois = rois + n * 5; int roi_batch_ind = offset_rois[0]; // Do not using rounding; this implementation detail is critical T roi_start_w = offset_rois[1] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_start_h = offset_rois[2] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_w = offset_rois[3] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_h = offset_rois[4] * spatial_scale - static_cast&lt;T&gt;(0.5); // Force too small ROIs to be 1x1 T roi_width = roi_end_w - roi_start_w; T roi_height = roi_end_h - roi_start_h; T bin_size_h = roi_height / static_cast&lt;T&gt;(pooled_height); T bin_size_w = roi_width / static_cast&lt;T&gt;(pooled_width); int c_in = channel_mapping[index]; T* grad_input_offset = grad_input + (roi_batch_ind * channels + c_in) * height * width; // Do not using floor/ceil; this implementation detail is critical T hstart = static_cast&lt;T&gt;(ph) * bin_size_h + roi_start_h; T wstart = static_cast&lt;T&gt;(pw) * bin_size_w + roi_start_w; const T grad_output_this_bin = grad_output[index]; // We use roi_bin_grid to sample the grid and mimic integral int roi_bin_grid_h = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_height / pooled_height); // e.g., = 2 int roi_bin_grid_w = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_width / pooled_width); const T count = roi_bin_grid_h * roi_bin_grid_w; for (int iy = 0; iy &lt; roi_bin_grid_h; iy++) { const T y = hstart + static_cast&lt;T&gt;(iy + .5f) * bin_size_h / static_cast&lt;T&gt;(roi_bin_grid_h); for (int ix = 0; ix &lt; roi_bin_grid_w; ix++) { const T x = wstart + static_cast&lt;T&gt;(ix + .5f) * bin_size_w / static_cast&lt;T&gt;(roi_bin_grid_w); T w1, w2, w3, w4; int x_low, x_high, y_low, y_high; bilinear_interpolate_gradient( height, width, y, x, w1, w2, w3, w4, x_low, x_high, y_low, y_high, index); T g1 = grad_output_this_bin * w1 / count; T g2 = grad_output_this_bin * w2 / count; T g3 = grad_output_this_bin * w3 / count; T g4 = grad_output_this_bin * w4 / count; if (x_low &gt;= 0 &amp;&amp; x_high &gt;= 0 &amp;&amp; y_low &gt;= 0 &amp;&amp; y_high &gt;= 0) { atomicAdd(grad_input_offset + y_low * width + x_low, g1); atomicAdd(grad_input_offset + y_low * width + x_high, g2); atomicAdd(grad_input_offset + y_high * width + x_low, g3); atomicAdd(grad_input_offset + y_high * width + x_high, g4); } // if } // ix } // iy } } std::tuple&lt;at::Tensor, at::Tensor&gt; PSROIAlign_forward_cuda( const at::Tensor&amp; input, const at::Tensor&amp; rois, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio) { // Check if input tensors are CUDA tensors AT_ASSERTM(input.type().is_cuda(), &quot;input must be a CUDA tensor&quot;); AT_ASSERTM(rois.type().is_cuda(), &quot;rois must be a CUDA tensor&quot;); at::TensorArg input_t{input, &quot;input&quot;, 1}, rois_t{rois, &quot;rois&quot;, 2}; at::CheckedFrom c = &quot;PSROIAlign_forward_cuda&quot;; at::checkAllSameGPU(c, {input_t, rois_t}); at::checkAllSameType(c, {input_t, rois_t}); at::cuda::CUDAGuard device_guard(input.device()); auto num_rois = rois.size(0); auto channels = input.size(1); auto height = input.size(2); auto width = input.size(3); AT_ASSERTM( channels % (pooled_height * pooled_width) == 0, &quot;input channels must be a multiple of pooling height * pooling width&quot;); int channels_out = channels / (pooled_height * pooled_width); auto output = at::zeros( {num_rois, channels_out, pooled_height, pooled_width}, input.options()); auto channel_mapping = at::zeros(output.sizes(), input.options().dtype(at::kInt)); auto output_size = output.numel(); if (output_size == 0) { AT_CUDA_CHECK(cudaGetLastError()); return std::make_tuple(output, channel_mapping); } cudaStream_t stream = at::cuda::getCurrentCUDAStream(); dim3 grid(std::min( at::cuda::ATenCeilDiv( static_cast&lt;int64_t&gt;(output_size), static_cast&lt;int64_t&gt;(512)), static_cast&lt;int64_t&gt;(4096))); dim3 block(512); AT_DISPATCH_FLOATING_TYPES_AND_HALF( input.scalar_type(), &quot;PSROIAlign_forward&quot;, [&amp;] { PSROIAlignForwardCUDA&lt;scalar_t&gt;&lt;&lt;&lt;grid, block, 0, stream&gt;&gt;&gt;( output_size, input.contiguous().data_ptr&lt;scalar_t&gt;(), spatial_scale, channels, height, width, pooled_height, pooled_width, sampling_ratio, rois.contiguous().data_ptr&lt;scalar_t&gt;(), channels_out, output.data_ptr&lt;scalar_t&gt;(), channel_mapping.data_ptr&lt;int&gt;()); }); AT_CUDA_CHECK(cudaGetLastError()); cudaDeviceSynchronize(); return std::make_tuple(output, channel_mapping); } at::Tensor PSROIAlign_backward_cuda( const at::Tensor&amp; grad, const at::Tensor&amp; rois, const at::Tensor&amp; channel_mapping, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio, const int batch_size, const int channels, const int height, const int width) { // Check if input tensors are CUDA tensors AT_ASSERTM(grad.type().is_cuda(), &quot;grad must be a CUDA tensor&quot;); AT_ASSERTM(rois.type().is_cuda(), &quot;rois must be a CUDA tensor&quot;); AT_ASSERTM( channel_mapping.type().is_cuda(), &quot;channel_mapping must be a CUDA tensor&quot;); at::TensorArg grad_t{grad, &quot;grad&quot;, 1}, rois_t{rois, &quot;rois&quot;, 2}, channel_mapping_t{channel_mapping, &quot;channel_mapping&quot;, 3}; at::CheckedFrom c = &quot;PSROIAlign_backward_cuda&quot;; at::checkAllSameGPU(c, {grad_t, rois_t, channel_mapping_t}); at::checkAllSameType(c, {grad_t, rois_t}); at::cuda::CUDAGuard device_guard(grad.device()); auto num_rois = rois.size(0); auto grad_input = at::zeros({batch_size, channels, height, width}, grad.options()); cudaStream_t stream = at::cuda::getCurrentCUDAStream(); dim3 grid(std::min( at::cuda::ATenCeilDiv( static_cast&lt;int64_t&gt;(grad.numel()), static_cast&lt;int64_t&gt;(512)), static_cast&lt;int64_t&gt;(4096))); dim3 block(512); // handle possibly empty gradients if (grad.numel() == 0) { AT_CUDA_CHECK(cudaGetLastError()); return grad_input; } int channels_out = channels / (pooled_height * pooled_width); AT_DISPATCH_FLOATING_TYPES_AND_HALF( grad.scalar_type(), &quot;PSROIAlign_backward&quot;, [&amp;] { PSROIAlignBackwardCUDA&lt;scalar_t&gt;&lt;&lt;&lt;grid, block, 0, stream&gt;&gt;&gt;( grad.numel(), grad.contiguous().data_ptr&lt;scalar_t&gt;(), channel_mapping.data_ptr&lt;int&gt;(), num_rois, spatial_scale, channels, height, width, pooled_height, pooled_width, sampling_ratio, channels_out, grad_input.data_ptr&lt;scalar_t&gt;(), rois.contiguous().data_ptr&lt;scalar_t&gt;()); }); AT_CUDA_CHECK(cudaGetLastError()); return grad_input; }"><pre class="notranslate"><span class="pl-k">#include</span> <span class="pl-s">&lt;ATen/cuda/CUDAApplyUtils.cuh&gt;</span> <span class="pl-k">#include</span> <span class="pl-s">"PSROIAlign_cuda.h"</span> <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">__device__</span> <span class="pl-smi">T</span> <span class="pl-en">bilinear_interpolate</span>( <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">input</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-smi">T</span> <span class="pl-s1">y</span>, <span class="pl-smi">T</span> <span class="pl-s1">x</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">index</span> <span class="pl-c">/* index for debug only*/</span>) { <span class="pl-c">// deal with cases that inverse elements are out of feature map boundary</span> <span class="pl-k">if</span> (<span class="pl-s1">y</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">y</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">height</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">width</span>) { <span class="pl-c">// empty</span> <span class="pl-k">return</span> <span class="pl-c1">0</span>; } <span class="pl-k">if</span> (<span class="pl-s1">y</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">if</span> (<span class="pl-s1">x</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-smi">int</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">y</span>; <span class="pl-smi">int</span> <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">x</span>; <span class="pl-smi">int</span> <span class="pl-s1">y_high</span>; <span class="pl-smi">int</span> <span class="pl-s1">x_high</span>; <span class="pl-k">if</span> (<span class="pl-s1">y_low</span> &gt;= <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">y</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">y_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-k">if</span> (<span class="pl-s1">x_low</span> &gt;= <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">x</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">x_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-smi">T</span> <span class="pl-s1">ly</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span> <span class="pl-c1">-</span> <span class="pl-s1">y_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">lx</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span> <span class="pl-c1">-</span> <span class="pl-s1">x_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">hy</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">ly</span>, <span class="pl-s1">hx</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">lx</span>; <span class="pl-c">// do bilinear interpolation</span> <span class="pl-smi">T</span> <span class="pl-s1">v1</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>]; <span class="pl-smi">T</span> <span class="pl-s1">v2</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>]; <span class="pl-smi">T</span> <span class="pl-s1">v3</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>]; <span class="pl-smi">T</span> <span class="pl-s1">v4</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>]; <span class="pl-smi">T</span> <span class="pl-s1">w1</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w2</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>, <span class="pl-s1">w3</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w4</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>; <span class="pl-smi">T</span> <span class="pl-s1">val</span> <span class="pl-c1">=</span> (<span class="pl-s1">w1</span> <span class="pl-c1">*</span> <span class="pl-s1">v1</span> <span class="pl-c1">+</span> <span class="pl-s1">w2</span> <span class="pl-c1">*</span> <span class="pl-s1">v2</span> <span class="pl-c1">+</span> <span class="pl-s1">w3</span> <span class="pl-c1">*</span> <span class="pl-s1">v3</span> <span class="pl-c1">+</span> <span class="pl-s1">w4</span> <span class="pl-c1">*</span> <span class="pl-s1">v4</span>); <span class="pl-k">return</span> <span class="pl-s1">val</span>; } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">__global__</span> <span class="pl-smi">void</span> <span class="pl-en">PSROIAlignForwardCUDA</span>( <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">nthreads</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">input</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">rois</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span>, <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">output</span>, <span class="pl-smi">int</span><span class="pl-c1">*</span> <span class="pl-s1">channel_mapping</span>) { <span class="pl-en">CUDA_1D_KERNEL_LOOP</span>(<span class="pl-s1">index</span>, <span class="pl-s1">nthreads</span>) { <span class="pl-c">// (n, c_out, ph, pw) is an element in the pooled output</span> <span class="pl-smi">int</span> <span class="pl-s1">pw</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span> % <span class="pl-s1">pooled_width</span>; <span class="pl-smi">int</span> <span class="pl-s1">ph</span> <span class="pl-c1">=</span> (<span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span>) % <span class="pl-s1">pooled_height</span>; <span class="pl-smi">int</span> <span class="pl-s1">c_out</span> <span class="pl-c1">=</span> (<span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span> / <span class="pl-s1">pooled_height</span>) % <span class="pl-s1">channels_out</span>; <span class="pl-smi">int</span> <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span> / <span class="pl-s1">pooled_height</span> / <span class="pl-s1">channels_out</span>; <span class="pl-c">// (n, c_in, ph, pw) is the associated element in the input</span> <span class="pl-smi">int</span> <span class="pl-s1">c_in</span> <span class="pl-c1">=</span> (<span class="pl-s1">c_out</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_height</span> <span class="pl-c1">+</span> <span class="pl-s1">ph</span>) <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span> <span class="pl-c1">+</span> <span class="pl-s1">pw</span>; <span class="pl-c">// [start, end) interval for spatial sampling</span> <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">offset_rois</span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span> <span class="pl-c1">+</span> <span class="pl-s1">n</span> <span class="pl-c1">*</span> <span class="pl-c1">5</span>; <span class="pl-smi">int</span> <span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">0</span>]; <span class="pl-c">// Do not using rounding; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">roi_start_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">1</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_start_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">2</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">3</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">4</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_width</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-smi">T</span> <span class="pl-s1">roi_height</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_height</span>) / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_height</span>); <span class="pl-smi">T</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_width</span>) / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_width</span>); <span class="pl-c">// Do not using floor/ceil; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">hstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ph</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">wstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pw</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-c">// We use roi_bin_grid to sample the grid and mimic integral</span> <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_height</span> / <span class="pl-s1">pooled_height</span>); <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_w</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_width</span> / <span class="pl-s1">pooled_width</span>); <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">*</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">offset_input</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span> <span class="pl-c1">+</span> (<span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">*</span> <span class="pl-s1">channels</span> <span class="pl-c1">+</span> <span class="pl-s1">c_in</span>) <span class="pl-c1">*</span> <span class="pl-s1">height</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span>; <span class="pl-smi">T</span> <span class="pl-s1">out_sum</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">iy</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">iy</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_h</span>; <span class="pl-s1">iy</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">hstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">iy</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_h</span>); <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">ix</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">ix</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-s1">ix</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">wstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ix</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_w</span>); <span class="pl-smi">T</span> <span class="pl-s1">val</span> <span class="pl-c1">=</span> <span class="pl-en">bilinear_interpolate</span>(<span class="pl-s1">offset_input</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">y</span>, <span class="pl-s1">x</span>, <span class="pl-s1">index</span>); <span class="pl-s1">out_sum</span> <span class="pl-c1">+=</span> <span class="pl-s1">val</span>; } } <span class="pl-s1">out_sum</span> /= <span class="pl-s1">count</span>; <span class="pl-s1">output</span>[<span class="pl-s1">index</span>] <span class="pl-c1">=</span> <span class="pl-s1">out_sum</span>; <span class="pl-s1">channel_mapping</span>[<span class="pl-s1">index</span>] <span class="pl-c1">=</span> <span class="pl-s1">c_in</span>; } } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">__device__</span> <span class="pl-smi">void</span> <span class="pl-en">bilinear_interpolate_gradient</span>( <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-smi">T</span> <span class="pl-s1">y</span>, <span class="pl-smi">T</span> <span class="pl-s1">x</span>, <span class="pl-smi">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w1</span>, <span class="pl-smi">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w2</span>, <span class="pl-smi">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w3</span>, <span class="pl-smi">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w4</span>, <span class="pl-smi">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">x_low</span>, <span class="pl-smi">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">x_high</span>, <span class="pl-smi">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">y_low</span>, <span class="pl-smi">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">y_high</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">index</span> <span class="pl-c">/* index for debug only*/</span>) { <span class="pl-c">// deal with cases that inverse elements are out of feature map boundary</span> <span class="pl-k">if</span> (<span class="pl-s1">y</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">y</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">height</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">width</span>) { <span class="pl-c">// empty</span> <span class="pl-s1">w1</span> <span class="pl-c1">=</span> <span class="pl-s1">w2</span> <span class="pl-c1">=</span> <span class="pl-s1">w3</span> <span class="pl-c1">=</span> <span class="pl-s1">w4</span> <span class="pl-c1">=</span> <span class="pl-c1">0.</span>; <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-c1">-1</span>; <span class="pl-k">return</span>; } <span class="pl-k">if</span> (<span class="pl-s1">y</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">if</span> (<span class="pl-s1">x</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">y</span>; <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">x</span>; <span class="pl-k">if</span> (<span class="pl-s1">y_low</span> &gt;= <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">y</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">y_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-k">if</span> (<span class="pl-s1">x_low</span> &gt;= <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">x</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">x_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-smi">T</span> <span class="pl-s1">ly</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span> <span class="pl-c1">-</span> <span class="pl-s1">y_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">lx</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span> <span class="pl-c1">-</span> <span class="pl-s1">x_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">hy</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">ly</span>, <span class="pl-s1">hx</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">lx</span>; <span class="pl-c">// reference in forward</span> <span class="pl-c">// T v1 = input[y_low * width + x_low];</span> <span class="pl-c">// T v2 = input[y_low * width + x_high];</span> <span class="pl-c">// T v3 = input[y_high * width + x_low];</span> <span class="pl-c">// T v4 = input[y_high * width + x_high];</span> <span class="pl-c">// T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4);</span> <span class="pl-s1">w1</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w2</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>, <span class="pl-s1">w3</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w4</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>; <span class="pl-k">return</span>; } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">__global__</span> <span class="pl-smi">void</span> <span class="pl-en">PSROIAlignBackwardCUDA</span>( <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">nthreads</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">grad_output</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span><span class="pl-c1">*</span> <span class="pl-s1">channel_mapping</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">num_rois</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span>, <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">grad_input</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">rois</span>) { <span class="pl-en">CUDA_1D_KERNEL_LOOP</span>(<span class="pl-s1">index</span>, <span class="pl-s1">nthreads</span>) { <span class="pl-c">// (n, *, ph, pw) is an element in the pooled output</span> <span class="pl-smi">int</span> <span class="pl-s1">pw</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span> % <span class="pl-s1">pooled_width</span>; <span class="pl-smi">int</span> <span class="pl-s1">ph</span> <span class="pl-c1">=</span> (<span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span>) % <span class="pl-s1">pooled_height</span>; <span class="pl-smi">int</span> <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span> / <span class="pl-s1">pooled_height</span> / <span class="pl-s1">channels_out</span>; <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">offset_rois</span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span> <span class="pl-c1">+</span> <span class="pl-s1">n</span> <span class="pl-c1">*</span> <span class="pl-c1">5</span>; <span class="pl-smi">int</span> <span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">0</span>]; <span class="pl-c">// Do not using rounding; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">roi_start_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">1</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_start_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">2</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">3</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">4</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-c">// Force too small ROIs to be 1x1</span> <span class="pl-smi">T</span> <span class="pl-s1">roi_width</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-smi">T</span> <span class="pl-s1">roi_height</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_height</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_height</span>); <span class="pl-smi">T</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_width</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_width</span>); <span class="pl-smi">int</span> <span class="pl-s1">c_in</span> <span class="pl-c1">=</span> <span class="pl-s1">channel_mapping</span>[<span class="pl-s1">index</span>]; <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">grad_input_offset</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_input</span> <span class="pl-c1">+</span> (<span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">*</span> <span class="pl-s1">channels</span> <span class="pl-c1">+</span> <span class="pl-s1">c_in</span>) <span class="pl-c1">*</span> <span class="pl-s1">height</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span>; <span class="pl-c">// Do not using floor/ceil; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">hstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ph</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">wstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pw</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output</span>[<span class="pl-s1">index</span>]; <span class="pl-c">// We use roi_bin_grid to sample the grid and mimic integral</span> <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_height</span> / <span class="pl-s1">pooled_height</span>); <span class="pl-c">// e.g., = 2</span> <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_w</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_width</span> / <span class="pl-s1">pooled_width</span>); <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">*</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">iy</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">iy</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_h</span>; <span class="pl-s1">iy</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">hstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">iy</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_h</span>); <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">ix</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">ix</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-s1">ix</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">wstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ix</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_w</span>); <span class="pl-smi">T</span> <span class="pl-s1">w1</span>, <span class="pl-s1">w2</span>, <span class="pl-s1">w3</span>, <span class="pl-s1">w4</span>; <span class="pl-smi">int</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">x_high</span>, <span class="pl-s1">y_low</span>, <span class="pl-s1">y_high</span>; <span class="pl-en">bilinear_interpolate_gradient</span>( <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">y</span>, <span class="pl-s1">x</span>, <span class="pl-s1">w1</span>, <span class="pl-s1">w2</span>, <span class="pl-s1">w3</span>, <span class="pl-s1">w4</span>, <span class="pl-s1">x_low</span>, <span class="pl-s1">x_high</span>, <span class="pl-s1">y_low</span>, <span class="pl-s1">y_high</span>, <span class="pl-s1">index</span>); <span class="pl-smi">T</span> <span class="pl-s1">g1</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w1</span> / <span class="pl-s1">count</span>; <span class="pl-smi">T</span> <span class="pl-s1">g2</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w2</span> / <span class="pl-s1">count</span>; <span class="pl-smi">T</span> <span class="pl-s1">g3</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w3</span> / <span class="pl-s1">count</span>; <span class="pl-smi">T</span> <span class="pl-s1">g4</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w4</span> / <span class="pl-s1">count</span>; <span class="pl-k">if</span> (<span class="pl-s1">x_low</span> &gt;= <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">x_high</span> &gt;= <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">y_low</span> &gt;= <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">y_high</span> &gt;= <span class="pl-c1">0</span>) { <span class="pl-en">atomicAdd</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">g1</span>); <span class="pl-en">atomicAdd</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>, <span class="pl-s1">g2</span>); <span class="pl-en">atomicAdd</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">g3</span>); <span class="pl-en">atomicAdd</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>, <span class="pl-s1">g4</span>); } <span class="pl-c">// if</span> } <span class="pl-c">// ix</span> } <span class="pl-c">// iy</span> } } <span class="pl-ent">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span>, <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span> <span class="pl-en">PSROIAlign_forward_cuda</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>) { <span class="pl-c">// Check if input tensors are CUDA tensors</span> <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">input</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>(), <span class="pl-s">"input must be a CUDA tensor"</span>); <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">rois</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>(), <span class="pl-s">"rois must be a CUDA tensor"</span>); <span class="pl-s1">at</span>::<span class="pl-s1">TensorArg</span> <span class="pl-s1">input_t</span>{<span class="pl-s1">input</span>, <span class="pl-s">"input"</span>, <span class="pl-c1">1</span>}, <span class="pl-s1">rois_t</span>{<span class="pl-s1">rois</span>, <span class="pl-s">"rois"</span>, <span class="pl-c1">2</span>}; <span class="pl-ent">at</span>::<span class="pl-s1">CheckedFrom</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s">"PSROIAlign_forward_cuda"</span>; <span class="pl-ent">at</span>::<span class="pl-s1">checkAllSameGPU</span>(<span class="pl-s1">c</span>, {<span class="pl-s1">input_t</span>, <span class="pl-s1">rois_t</span>}); <span class="pl-ent">at</span>::<span class="pl-s1">checkAllSameType</span>(<span class="pl-s1">c</span>, {<span class="pl-s1">input_t</span>, <span class="pl-s1">rois_t</span>}); <span class="pl-ent">at</span>::<span class="pl-ent">cuda</span>::<span class="pl-s1">CUDAGuard</span> <span class="pl-en">device_guard</span>(<span class="pl-s1">input</span>.<span class="pl-en">device</span>()); auto <span class="pl-smi">num_rois</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span>.<span class="pl-en">size</span>(<span class="pl-c1">0</span>); auto <span class="pl-smi">channels</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">size</span>(<span class="pl-c1">1</span>); auto <span class="pl-smi">height</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">size</span>(<span class="pl-c1">2</span>); auto <span class="pl-smi">width</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">size</span>(<span class="pl-c1">3</span>); <span class="pl-en">AT_ASSERTM</span>( <span class="pl-s1">channels</span> % (<span class="pl-s1">pooled_height</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span>) <span class="pl-c1">==</span> <span class="pl-c1">0</span>, <span class="pl-s">"input channels must be a multiple of pooling height * pooling width"</span>); <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span> <span class="pl-c1">=</span> <span class="pl-s1">channels</span> / (<span class="pl-s1">pooled_height</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span>); auto <span class="pl-smi">output</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-en">zeros</span>( {<span class="pl-smi">num_rois</span>, <span class="pl-smi">channels_out</span>, <span class="pl-smi">pooled_height</span>, <span class="pl-smi">pooled_width</span>}, <span class="pl-smi">input</span>.<span class="pl-en">options</span>()); auto <span class="pl-smi">channel_mapping</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-en">zeros</span>(<span class="pl-smi">output</span>.<span class="pl-en">sizes</span>(), <span class="pl-smi">input</span>.<span class="pl-en">options</span>().<span class="pl-en">dtype</span>(<span class="pl-smi">at</span>::<span class="pl-s1">kInt</span>)); auto <span class="pl-smi">output_size</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">output</span>.<span class="pl-en">numel</span>(); <span class="pl-k">if</span> (<span class="pl-s1">output_size</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span>) { <span class="pl-en">AT_CUDA_CHECK</span>(<span class="pl-en">cudaGetLastError</span>()); <span class="pl-k">return</span> <span class="pl-s1">std</span>::<span class="pl-en">make_tuple</span>(<span class="pl-s1">output</span>, <span class="pl-s1">channel_mapping</span>); } <span class="pl-smi">cudaStream_t</span> <span class="pl-s1">stream</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-s1">cuda</span>::<span class="pl-en">getCurrentCUDAStream</span>(); <span class="pl-smi">dim3</span> <span class="pl-en">grid</span>(<span class="pl-smi">std</span>::<span class="pl-en">min</span>( <span class="pl-smi">at</span>::<span class="pl-s1">cuda</span>::<span class="pl-en">ATenCeilDiv</span>( <span class="pl-smi">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-smi">int64_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">output_size</span>), <span class="pl-smi">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-smi">int64_t</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">512</span>)), <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-smi">int64_t</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">4096</span>))); <span class="pl-smi">dim3</span> <span class="pl-en">block</span>(<span class="pl-c1">512</span>); <span class="pl-en">AT_DISPATCH_FLOATING_TYPES_AND_HALF</span>( <span class="pl-s1">input</span>.<span class="pl-en">scalar_type</span>(), <span class="pl-s">"PSROIAlign_forward"</span>, [<span class="pl-c1">&amp;</span>] { <span class="pl-s1">PSROIAlignForwardCUDA</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>&lt;&lt;<span class="pl-c1">&lt;</span><span class="pl-s1">grid</span>, <span class="pl-s1">block</span>, <span class="pl-c1">0</span>, <span class="pl-s1">stream</span>&gt;&gt;<span class="pl-s1"></span><span class="pl-c1">&gt;</span>( <span class="pl-s1">output_size</span>, <span class="pl-s1">input</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">channels</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">rois</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">channels_out</span>, <span class="pl-s1">output</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">channel_mapping</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">int</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>)); }); <span class="pl-en">AT_CUDA_CHECK</span>(<span class="pl-en">cudaGetLastError</span>()); <span class="pl-en">cudaDeviceSynchronize</span>(); <span class="pl-k">return</span> <span class="pl-s1">std</span>::<span class="pl-en">make_tuple</span>(<span class="pl-s1">output</span>, <span class="pl-s1">channel_mapping</span>); } <span class="pl-ent">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-en">PSROIAlign_backward_cuda</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">grad</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">channel_mapping</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">batch_size</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">width</span>) { <span class="pl-c">// Check if input tensors are CUDA tensors</span> <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">grad</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>(), <span class="pl-s">"grad must be a CUDA tensor"</span>); <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">rois</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>(), <span class="pl-s">"rois must be a CUDA tensor"</span>); <span class="pl-en">AT_ASSERTM</span>( <span class="pl-s1">channel_mapping</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>(), <span class="pl-s">"channel_mapping must be a CUDA tensor"</span>); <span class="pl-s1">at</span>::<span class="pl-s1">TensorArg</span> <span class="pl-s1">grad_t</span>{<span class="pl-s1">grad</span>, <span class="pl-s">"grad"</span>, <span class="pl-c1">1</span>}, <span class="pl-s1">rois_t</span>{<span class="pl-s1">rois</span>, <span class="pl-s">"rois"</span>, <span class="pl-c1">2</span>}, <span class="pl-s1">channel_mapping_t</span>{<span class="pl-s1">channel_mapping</span>, <span class="pl-s">"channel_mapping"</span>, <span class="pl-c1">3</span>}; <span class="pl-ent">at</span>::<span class="pl-s1">CheckedFrom</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s">"PSROIAlign_backward_cuda"</span>; <span class="pl-ent">at</span>::<span class="pl-s1">checkAllSameGPU</span>(<span class="pl-s1">c</span>, {<span class="pl-s1">grad_t</span>, <span class="pl-s1">rois_t</span>, <span class="pl-s1">channel_mapping_t</span>}); <span class="pl-ent">at</span>::<span class="pl-s1">checkAllSameType</span>(<span class="pl-s1">c</span>, {<span class="pl-s1">grad_t</span>, <span class="pl-s1">rois_t</span>}); <span class="pl-ent">at</span>::<span class="pl-ent">cuda</span>::<span class="pl-s1">CUDAGuard</span> <span class="pl-en">device_guard</span>(<span class="pl-s1">grad</span>.<span class="pl-en">device</span>()); auto <span class="pl-smi">num_rois</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span>.<span class="pl-en">size</span>(<span class="pl-c1">0</span>); auto <span class="pl-smi">grad_input</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-en">zeros</span>({<span class="pl-smi">batch_size</span>, <span class="pl-smi">channels</span>, <span class="pl-smi">height</span>, <span class="pl-smi">width</span>}, <span class="pl-smi">grad</span>.<span class="pl-en">options</span>()); <span class="pl-smi">cudaStream_t</span> <span class="pl-s1">stream</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-s1">cuda</span>::<span class="pl-en">getCurrentCUDAStream</span>(); <span class="pl-smi">dim3</span> <span class="pl-en">grid</span>(<span class="pl-smi">std</span>::<span class="pl-en">min</span>( <span class="pl-smi">at</span>::<span class="pl-s1">cuda</span>::<span class="pl-en">ATenCeilDiv</span>( <span class="pl-smi">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-smi">int64_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">grad</span>.<span class="pl-en">numel</span>()), <span class="pl-smi">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-smi">int64_t</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">512</span>)), <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-smi">int64_t</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">4096</span>))); <span class="pl-smi">dim3</span> <span class="pl-en">block</span>(<span class="pl-c1">512</span>); <span class="pl-c">// handle possibly empty gradients</span> <span class="pl-k">if</span> (<span class="pl-s1">grad</span>.<span class="pl-en">numel</span>() <span class="pl-c1">==</span> <span class="pl-c1">0</span>) { <span class="pl-en">AT_CUDA_CHECK</span>(<span class="pl-en">cudaGetLastError</span>()); <span class="pl-k">return</span> <span class="pl-s1">grad_input</span>; } <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span> <span class="pl-c1">=</span> <span class="pl-s1">channels</span> / (<span class="pl-s1">pooled_height</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span>); <span class="pl-en">AT_DISPATCH_FLOATING_TYPES_AND_HALF</span>( <span class="pl-s1">grad</span>.<span class="pl-en">scalar_type</span>(), <span class="pl-s">"PSROIAlign_backward"</span>, [<span class="pl-c1">&amp;</span>] { <span class="pl-s1">PSROIAlignBackwardCUDA</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>&lt;&lt;<span class="pl-c1">&lt;</span><span class="pl-s1">grid</span>, <span class="pl-s1">block</span>, <span class="pl-c1">0</span>, <span class="pl-s1">stream</span>&gt;&gt;<span class="pl-s1"></span><span class="pl-c1">&gt;</span>( <span class="pl-s1">grad</span>.<span class="pl-en">numel</span>(), <span class="pl-s1">grad</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">channel_mapping</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">int</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">num_rois</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">channels</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">channels_out</span>, <span class="pl-s1">grad_input</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">rois</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>)); }); <span class="pl-en">AT_CUDA_CHECK</span>(<span class="pl-en">cudaGetLastError</span>()); <span class="pl-k">return</span> <span class="pl-s1">grad_input</span>; }</pre></div> </details> <details> <summary> PSROIAlign_cuda.h </summary> <div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#pragma once #include &lt;torch/torch.h&gt; #include &lt;c10/cuda/CUDAGuard.h&gt; #define CUDA_1D_KERNEL_LOOP(i, n) \ for (int i = (blockIdx.x * blockDim.x) + threadIdx.x; i &lt; (n); \ i += (blockDim.x * gridDim.x)) std::tuple&lt;at::Tensor, at::Tensor&gt; PSROIAlign_forward_cuda( const at::Tensor&amp; input, const at::Tensor&amp; rois, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio); at::Tensor PSROIAlign_backward_cuda( const at::Tensor&amp; grad, const at::Tensor&amp; rois, const at::Tensor&amp; mapping_channel, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio, const int batch_size, const int channels, const int height, const int width);"><pre class="notranslate"><span class="pl-k">#pragma</span> once <span class="pl-k">#include</span> <span class="pl-s">&lt;torch/torch.h&gt;</span> <span class="pl-k">#include</span> <span class="pl-s">&lt;c10/cuda/CUDAGuard.h&gt;</span> <span class="pl-k">#define</span> <span class="pl-en">CUDA_1D_KERNEL_LOOP</span>(<span class="pl-s1">i</span>, <span class="pl-s1">n</span>) \ for (int i = (blockIdx.x * blockDim.x) + threadIdx.x; i &lt; (n); \ i += (blockDim.x * gridDim.x)) <span class="pl-ent">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span>, <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span> <span class="pl-en">PSROIAlign_forward_cuda</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>); <span class="pl-ent">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-en">PSROIAlign_backward_cuda</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">grad</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">mapping_channel</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">batch_size</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">width</span>);</pre></div> </details> <details> <summary> PSROIAlign_cpu.cpp </summary> <div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include &quot;PSROIAlign.h&quot; template &lt;typename T&gt; T bilinear_interpolate( const T* input, const int height, const int width, T y, T x, const int index /* index for debug only*/) { // deal with cases that inverse elements are out of feature map boundary if (y &lt; -1.0 || y &gt; height || x &lt; -1.0 || x &gt; width) { // empty return 0; } if (y &lt;= 0) y = 0; if (x &lt;= 0) x = 0; int y_low = (int)y; int x_low = (int)x; int y_high; int x_high; if (y_low &gt;= height - 1) { y_high = y_low = height - 1; y = (T)y_low; } else { y_high = y_low + 1; } if (x_low &gt;= width - 1) { x_high = x_low = width - 1; x = (T)x_low; } else { x_high = x_low + 1; } T ly = y - y_low; T lx = x - x_low; T hy = 1. - ly, hx = 1. - lx; // do bilinear interpolation T v1 = input[y_low * width + x_low]; T v2 = input[y_low * width + x_high]; T v3 = input[y_high * width + x_low]; T v4 = input[y_high * width + x_high]; T w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx; T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4); return val; } template &lt;typename T&gt; void PSROIAlignForwardCPU( const int nthreads, const T* input, const T spatial_scale, const int channels, const int height, const int width, const int pooled_height, const int pooled_width, const int sampling_ratio, const T* rois, const int channels_out, T* output, int* channel_mapping) { int num_rois = nthreads / channels_out / pooled_width / pooled_height; for (int n = 0; n &lt; num_rois; n++) { // [start, end) interval for spatial sampling const T* offset_rois = rois + n * 5; int roi_batch_ind = offset_rois[0]; // Do not using rounding; this implementation detail is critical T roi_start_w = offset_rois[1] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_start_h = offset_rois[2] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_w = offset_rois[3] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_h = offset_rois[4] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_width = roi_end_w - roi_start_w; T roi_height = roi_end_h - roi_start_h; T bin_size_h = static_cast&lt;T&gt;(roi_height) / static_cast&lt;T&gt;(pooled_height); T bin_size_w = static_cast&lt;T&gt;(roi_width) / static_cast&lt;T&gt;(pooled_width); int c_in = 0; for (int c_out = 0; c_out &lt; channels_out; ++c_out) { for (int ph = 0; ph &lt; pooled_height; ++ph) { for (int pw = 0; pw &lt; pooled_width; ++pw) { int index = ((n * channels_out + c_out) * pooled_height + ph) * pooled_width + pw; // Do not using floor/ceil; this implementation detail is critical T hstart = static_cast&lt;T&gt;(ph) * bin_size_h + roi_start_h; T wstart = static_cast&lt;T&gt;(pw) * bin_size_w + roi_start_w; // We use roi_bin_grid to sample the grid and mimic integral int roi_bin_grid_h = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_height / pooled_height); int roi_bin_grid_w = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_width / pooled_width); const T count = roi_bin_grid_h * roi_bin_grid_w; const T* offset_input = input + (roi_batch_ind * channels + c_in) * height * width; T out_sum = 0; for (int iy = 0; iy &lt; roi_bin_grid_h; iy++) { const T y = hstart + static_cast&lt;T&gt;(iy + .5f) * bin_size_h / static_cast&lt;T&gt;(roi_bin_grid_h); for (int ix = 0; ix &lt; roi_bin_grid_w; ix++) { const T x = wstart + static_cast&lt;T&gt;(ix + .5f) * bin_size_w / static_cast&lt;T&gt;(roi_bin_grid_w); T val = bilinear_interpolate( offset_input, height, width, y, x, index); out_sum += val; } } out_sum /= count; output[index] = out_sum; channel_mapping[index] = c_in; c_in++; } } } } } template &lt;typename T&gt; void bilinear_interpolate_gradient( const int height, const int width, T y, T x, T&amp; w1, T&amp; w2, T&amp; w3, T&amp; w4, int&amp; x_low, int&amp; x_high, int&amp; y_low, int&amp; y_high, const int index /* index for debug only*/) { // deal with cases that inverse elements are out of feature map boundary if (y &lt; -1.0 || y &gt; height || x &lt; -1.0 || x &gt; width) { // empty w1 = w2 = w3 = w4 = 0.; x_low = x_high = y_low = y_high = -1; return; } if (y &lt;= 0) y = 0; if (x &lt;= 0) x = 0; y_low = (int)y; x_low = (int)x; if (y_low &gt;= height - 1) { y_high = y_low = height - 1; y = (T)y_low; } else { y_high = y_low + 1; } if (x_low &gt;= width - 1) { x_high = x_low = width - 1; x = (T)x_low; } else { x_high = x_low + 1; } T ly = y - y_low; T lx = x - x_low; T hy = 1. - ly, hx = 1. - lx; // reference in forward // T v1 = input[y_low * width + x_low]; // T v2 = input[y_low * width + x_high]; // T v3 = input[y_high * width + x_low]; // T v4 = input[y_high * width + x_high]; // T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4); w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx; return; } template &lt;class T&gt; inline void add(T* address, const T&amp; val) { *address += val; } template &lt;typename T&gt; void PSROIAlignBackwardCPU( const int nthreads, const T* grad_output, const int* channel_mapping, const int num_rois, const T spatial_scale, const int channels, const int height, const int width, const int pooled_height, const int pooled_width, const int sampling_ratio, const int channels_out, T* grad_input, const T* rois) { for (int index = 0; index &lt; nthreads; index++) { int pw = index % pooled_width; int ph = (index / pooled_width) % pooled_height; int n = index / pooled_width / pooled_height / channels_out; const T* offset_rois = rois + n * 5; int roi_batch_ind = offset_rois[0]; // Do not using rounding; this implementation detail is critical T roi_start_w = offset_rois[1] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_start_h = offset_rois[2] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_w = offset_rois[3] * spatial_scale - static_cast&lt;T&gt;(0.5); T roi_end_h = offset_rois[4] * spatial_scale - static_cast&lt;T&gt;(0.5); // Force too small ROIs to be 1x1 T roi_width = roi_end_w - roi_start_w; T roi_height = roi_end_h - roi_start_h; T bin_size_h = roi_height / static_cast&lt;T&gt;(pooled_height); T bin_size_w = roi_width / static_cast&lt;T&gt;(pooled_width); int c_in = channel_mapping[index]; T* grad_input_offset = grad_input + (roi_batch_ind * channels + c_in) * height * width; // Do not using floor/ceil; this implementation detail is critical T hstart = static_cast&lt;T&gt;(ph) * bin_size_h + roi_start_h; T wstart = static_cast&lt;T&gt;(pw) * bin_size_w + roi_start_w; const T grad_output_this_bin = grad_output[index]; // We use roi_bin_grid to sample the grid and mimic integral int roi_bin_grid_h = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_height / pooled_height); // e.g., = 2 int roi_bin_grid_w = (sampling_ratio &gt; 0) ? sampling_ratio : ceil(roi_width / pooled_width); const T count = roi_bin_grid_h * roi_bin_grid_w; for (int iy = 0; iy &lt; roi_bin_grid_h; iy++) { const T y = hstart + static_cast&lt;T&gt;(iy + .5f) * bin_size_h / static_cast&lt;T&gt;(roi_bin_grid_h); for (int ix = 0; ix &lt; roi_bin_grid_w; ix++) { const T x = wstart + static_cast&lt;T&gt;(ix + .5f) * bin_size_w / static_cast&lt;T&gt;(roi_bin_grid_w); T w1, w2, w3, w4; int x_low, x_high, y_low, y_high; bilinear_interpolate_gradient( height, width, y, x, w1, w2, w3, w4, x_low, x_high, y_low, y_high, index); T g1 = grad_output_this_bin * w1 / count; T g2 = grad_output_this_bin * w2 / count; T g3 = grad_output_this_bin * w3 / count; T g4 = grad_output_this_bin * w4 / count; if (x_low &gt;= 0 &amp;&amp; x_high &gt;= 0 &amp;&amp; y_low &gt;= 0 &amp;&amp; y_high &gt;= 0) { add(grad_input_offset + y_low * width + x_low, g1); add(grad_input_offset + y_low * width + x_high, g2); add(grad_input_offset + y_high * width + x_low, g3); add(grad_input_offset + y_high * width + x_high, g4); } // if } // ix } // iy } } std::tuple&lt;at::Tensor, at::Tensor&gt; PSROIAlign_forward_cpu( const at::Tensor&amp; input, const at::Tensor&amp; rois, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio) { // Check if input tensors are CPU tensors AT_ASSERTM(input.device().is_cpu(), &quot;input must be a CPU tensor&quot;); AT_ASSERTM(rois.device().is_cpu(), &quot;rois must be a CPU tensor&quot;); at::TensorArg input_t{input, &quot;input&quot;, 1}, rois_t{rois, &quot;rois&quot;, 2}; at::CheckedFrom c = &quot;PSROIAlign_forward_cpu&quot;; at::checkAllSameType(c, {input_t, rois_t}); int num_rois = rois.size(0); int channels = input.size(1); int height = input.size(2); int width = input.size(3); AT_ASSERTM( channels % (pooled_height * pooled_width) == 0, &quot;input channels must be a multiple of pooling height * pooling width&quot;); int channels_out = channels / (pooled_height * pooled_width); auto output = at::zeros( {num_rois, channels_out, pooled_height, pooled_width}, input.options()); auto channel_mapping = at::zeros(output.sizes(), input.options().dtype(at::kInt)); auto output_size = output.numel(); if (output_size == 0) { return std::make_tuple(output, channel_mapping); } AT_DISPATCH_FLOATING_TYPES_AND_HALF( input.scalar_type(), &quot;PSROIAlign_forward&quot;, [&amp;] { PSROIAlignForwardCPU&lt;scalar_t&gt;( output_size, input.contiguous().data_ptr&lt;scalar_t&gt;(), spatial_scale, channels, height, width, pooled_height, pooled_width, sampling_ratio, rois.contiguous().data_ptr&lt;scalar_t&gt;(), channels_out, output.data_ptr&lt;scalar_t&gt;(), channel_mapping.data_ptr&lt;int&gt;()); }); return std::make_tuple(output, channel_mapping); } at::Tensor PSROIAlign_backward_cpu( const at::Tensor&amp; grad, const at::Tensor&amp; rois, const at::Tensor&amp; channel_mapping, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio, const int batch_size, const int channels, const int height, const int width) { // Check if input tensors are CPU tensors AT_ASSERTM(grad.device().is_cpu(), &quot;grad must be a CPU tensor&quot;); AT_ASSERTM(rois.device().is_cpu(), &quot;rois must be a CPU tensor&quot;); AT_ASSERTM( channel_mapping.device().is_cpu(), &quot;channel_mapping must be a CPU tensor&quot;); at::TensorArg grad_t{grad, &quot;grad&quot;, 1}, rois_t{rois, &quot;rois&quot;, 2}, channel_mapping_t{channel_mapping, &quot;channel_mapping&quot;, 3}; at::CheckedFrom c = &quot;PSROIAlign_backward_cpu&quot;; at::checkAllSameType(c, {grad_t, rois_t}); auto num_rois = rois.size(0); auto grad_input = at::zeros({batch_size, channels, height, width}, grad.options()); // handle possibly empty gradients if (grad.numel() == 0) { return grad_input; } int channels_out = channels / (pooled_height * pooled_width); AT_DISPATCH_FLOATING_TYPES_AND_HALF( grad.scalar_type(), &quot;PSROIAlign_backward&quot;, [&amp;] { PSROIAlignBackwardCPU&lt;scalar_t&gt;( grad.numel(), grad.contiguous().data_ptr&lt;scalar_t&gt;(), channel_mapping.data_ptr&lt;int&gt;(), num_rois, spatial_scale, channels, height, width, pooled_height, pooled_width, sampling_ratio, channels_out, grad_input.data_ptr&lt;scalar_t&gt;(), rois.contiguous().data_ptr&lt;scalar_t&gt;()); }); return grad_input; }"><pre class="notranslate"><span class="pl-k">#include</span> <span class="pl-s">"PSROIAlign.h"</span> <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-c1">T</span> <span class="pl-s1">bilinear_interpolate</span>( <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-c1">T</span> <span class="pl-s1">y</span>, <span class="pl-c1">T</span> <span class="pl-s1">x</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">index</span> <span class="pl-c">/* index for debug only*/</span>) { <span class="pl-c">// deal with cases that inverse elements are out of feature map boundary</span> <span class="pl-k">if</span> (<span class="pl-s1">y</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">y</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">height</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">width</span>) { <span class="pl-c">// empty</span> <span class="pl-k">return</span> <span class="pl-c1">0</span>; } <span class="pl-k">if</span> (<span class="pl-s1">y</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">if</span> (<span class="pl-s1">x</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-smi">int</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">y</span>; <span class="pl-smi">int</span> <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">x</span>; <span class="pl-smi">int</span> <span class="pl-s1">y_high</span>; <span class="pl-smi">int</span> <span class="pl-s1">x_high</span>; <span class="pl-k">if</span> (<span class="pl-s1">y_low</span> &gt;= <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">y</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">y_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-k">if</span> (<span class="pl-s1">x_low</span> &gt;= <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">x</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">x_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-smi">T</span> <span class="pl-s1">ly</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span> <span class="pl-c1">-</span> <span class="pl-s1">y_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">lx</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span> <span class="pl-c1">-</span> <span class="pl-s1">x_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">hy</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">ly</span>, <span class="pl-s1">hx</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">lx</span>; <span class="pl-c">// do bilinear interpolation</span> <span class="pl-smi">T</span> <span class="pl-s1">v1</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>]; <span class="pl-smi">T</span> <span class="pl-s1">v2</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>]; <span class="pl-smi">T</span> <span class="pl-s1">v3</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>]; <span class="pl-smi">T</span> <span class="pl-s1">v4</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>[<span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>]; <span class="pl-smi">T</span> <span class="pl-s1">w1</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w2</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>, <span class="pl-s1">w3</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w4</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>; <span class="pl-smi">T</span> <span class="pl-s1">val</span> <span class="pl-c1">=</span> (<span class="pl-s1">w1</span> <span class="pl-c1">*</span> <span class="pl-s1">v1</span> <span class="pl-c1">+</span> <span class="pl-s1">w2</span> <span class="pl-c1">*</span> <span class="pl-s1">v2</span> <span class="pl-c1">+</span> <span class="pl-s1">w3</span> <span class="pl-c1">*</span> <span class="pl-s1">v3</span> <span class="pl-c1">+</span> <span class="pl-s1">w4</span> <span class="pl-c1">*</span> <span class="pl-s1">v4</span>); <span class="pl-k">return</span> <span class="pl-s1">val</span>; } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">void</span> <span class="pl-s1">PSROIAlignForwardCPU</span>( <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">nthreads</span>, <span class="pl-s1">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-smi">T</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span>, <span class="pl-c1">T</span><span class="pl-c1">*</span> <span class="pl-s1">output</span>, <span class="pl-s1">int</span><span class="pl-c1">*</span> <span class="pl-s1">channel_mapping</span>) { <span class="pl-smi">int</span> <span class="pl-s1">num_rois</span> <span class="pl-c1">=</span> <span class="pl-s1">nthreads</span> / <span class="pl-s1">channels_out</span> / <span class="pl-s1">pooled_width</span> / <span class="pl-s1">pooled_height</span>; <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">n</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">num_rois</span>; <span class="pl-s1">n</span><span class="pl-c1">++</span>) { <span class="pl-c">// [start, end) interval for spatial sampling</span> <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">offset_rois</span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span> <span class="pl-c1">+</span> <span class="pl-s1">n</span> <span class="pl-c1">*</span> <span class="pl-c1">5</span>; <span class="pl-smi">int</span> <span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">0</span>]; <span class="pl-c">// Do not using rounding; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">roi_start_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">1</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_start_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">2</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">3</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">4</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_width</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-smi">T</span> <span class="pl-s1">roi_height</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_height</span>) / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_height</span>); <span class="pl-smi">T</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_width</span>) / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_width</span>); <span class="pl-smi">int</span> <span class="pl-s1">c_in</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">c_out</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">c_out</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">channels_out</span>; <span class="pl-c1">++</span><span class="pl-s1">c_out</span>) { <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">ph</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">ph</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">pooled_height</span>; <span class="pl-c1">++</span><span class="pl-s1">ph</span>) { <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">pw</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">pw</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">pooled_width</span>; <span class="pl-c1">++</span><span class="pl-s1">pw</span>) { <span class="pl-smi">int</span> <span class="pl-s1">index</span> <span class="pl-c1">=</span> ((<span class="pl-s1">n</span> <span class="pl-c1">*</span> <span class="pl-s1">channels_out</span> <span class="pl-c1">+</span> <span class="pl-s1">c_out</span>) <span class="pl-c1">*</span> <span class="pl-s1">pooled_height</span> <span class="pl-c1">+</span> <span class="pl-s1">ph</span>) <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span> <span class="pl-c1">+</span> <span class="pl-s1">pw</span>; <span class="pl-c">// Do not using floor/ceil; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">hstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ph</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">wstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pw</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-c">// We use roi_bin_grid to sample the grid and mimic integral</span> <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_height</span> / <span class="pl-s1">pooled_height</span>); <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_w</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_width</span> / <span class="pl-s1">pooled_width</span>); <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">*</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">offset_input</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span> <span class="pl-c1">+</span> (<span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">*</span> <span class="pl-s1">channels</span> <span class="pl-c1">+</span> <span class="pl-s1">c_in</span>) <span class="pl-c1">*</span> <span class="pl-s1">height</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span>; <span class="pl-smi">T</span> <span class="pl-s1">out_sum</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">iy</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">iy</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_h</span>; <span class="pl-s1">iy</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">hstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">iy</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_h</span>); <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">ix</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">ix</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-s1">ix</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">wstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ix</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_w</span>); <span class="pl-smi">T</span> <span class="pl-s1">val</span> <span class="pl-c1">=</span> <span class="pl-en">bilinear_interpolate</span>( <span class="pl-s1">offset_input</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">y</span>, <span class="pl-s1">x</span>, <span class="pl-s1">index</span>); <span class="pl-s1">out_sum</span> <span class="pl-c1">+=</span> <span class="pl-s1">val</span>; } } <span class="pl-s1">out_sum</span> /= <span class="pl-s1">count</span>; <span class="pl-s1">output</span>[<span class="pl-s1">index</span>] <span class="pl-c1">=</span> <span class="pl-s1">out_sum</span>; <span class="pl-s1">channel_mapping</span>[<span class="pl-s1">index</span>] <span class="pl-c1">=</span> <span class="pl-s1">c_in</span>; <span class="pl-s1">c_in</span><span class="pl-c1">++</span>; } } } } } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">void</span> <span class="pl-s1">bilinear_interpolate_gradient</span>( <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-c1">T</span> <span class="pl-s1">y</span>, <span class="pl-c1">T</span> <span class="pl-s1">x</span>, <span class="pl-c1">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w1</span>, <span class="pl-c1">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w2</span>, <span class="pl-c1">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w3</span>, <span class="pl-c1">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">w4</span>, <span class="pl-s1">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">x_high</span>, <span class="pl-s1">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">y_low</span>, <span class="pl-s1">int</span><span class="pl-c1">&amp;</span> <span class="pl-s1">y_high</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">index</span> <span class="pl-c">/* index for debug only*/</span>) { <span class="pl-c">// deal with cases that inverse elements are out of feature map boundary</span> <span class="pl-k">if</span> (<span class="pl-s1">y</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">y</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">height</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&lt;</span> <span class="pl-c1">-1.0</span> <span class="pl-c1">||</span> <span class="pl-s1">x</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">width</span>) { <span class="pl-c">// empty</span> <span class="pl-s1">w1</span> <span class="pl-c1">=</span> <span class="pl-s1">w2</span> <span class="pl-c1">=</span> <span class="pl-s1">w3</span> <span class="pl-c1">=</span> <span class="pl-s1">w4</span> <span class="pl-c1">=</span> <span class="pl-c1">0.</span>; <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-c1">-1</span>; <span class="pl-k">return</span>; } <span class="pl-k">if</span> (<span class="pl-s1">y</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-k">if</span> (<span class="pl-s1">x</span> &lt;= <span class="pl-c1">0</span>) <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">y</span>; <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> (<span class="pl-smi">int</span>)<span class="pl-s1">x</span>; <span class="pl-k">if</span> (<span class="pl-s1">y_low</span> &gt;= <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">=</span> <span class="pl-s1">height</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">y</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">y_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">y_high</span> <span class="pl-c1">=</span> <span class="pl-s1">y_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-k">if</span> (<span class="pl-s1">x_low</span> &gt;= <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>) { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">=</span> <span class="pl-s1">width</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>; <span class="pl-s1">x</span> <span class="pl-c1">=</span> (<span class="pl-smi">T</span>)<span class="pl-s1">x_low</span>; } <span class="pl-k">else</span> { <span class="pl-s1">x_high</span> <span class="pl-c1">=</span> <span class="pl-s1">x_low</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>; } <span class="pl-smi">T</span> <span class="pl-s1">ly</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span> <span class="pl-c1">-</span> <span class="pl-s1">y_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">lx</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span> <span class="pl-c1">-</span> <span class="pl-s1">x_low</span>; <span class="pl-smi">T</span> <span class="pl-s1">hy</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">ly</span>, <span class="pl-s1">hx</span> <span class="pl-c1">=</span> <span class="pl-c1">1.</span> <span class="pl-c1">-</span> <span class="pl-s1">lx</span>; <span class="pl-c">// reference in forward</span> <span class="pl-c">// T v1 = input[y_low * width + x_low];</span> <span class="pl-c">// T v2 = input[y_low * width + x_high];</span> <span class="pl-c">// T v3 = input[y_high * width + x_low];</span> <span class="pl-c">// T v4 = input[y_high * width + x_high];</span> <span class="pl-c">// T val = (w1 * v1 + w2 * v2 + w3 * v3 + w4 * v4);</span> <span class="pl-s1">w1</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w2</span> <span class="pl-c1">=</span> <span class="pl-s1">hy</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>, <span class="pl-s1">w3</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">hx</span>, <span class="pl-s1">w4</span> <span class="pl-c1">=</span> <span class="pl-s1">ly</span> <span class="pl-c1">*</span> <span class="pl-s1">lx</span>; <span class="pl-k">return</span>; } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">class</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">inline</span> <span class="pl-smi">void</span> <span class="pl-en">add</span>(<span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">address</span>, <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">&amp;</span> <span class="pl-s1">val</span>) { <span class="pl-c1">*</span><span class="pl-s1">address</span> <span class="pl-c1">+=</span> <span class="pl-s1">val</span>; } <span class="pl-s1">template</span> <span class="pl-c1">&lt;</span><span class="pl-s1">typename</span> <span class="pl-c1">T</span><span class="pl-c1">&gt;</span> <span class="pl-s1">void</span> <span class="pl-s1">PSROIAlignBackwardCPU</span>( <span class="pl-k">const</span> <span class="pl-smi">int</span> <span class="pl-s1">nthreads</span>, <span class="pl-s1">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">grad_output</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span><span class="pl-c1">*</span> <span class="pl-s1">channel_mapping</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">num_rois</span>, <span class="pl-s1">const</span> <span class="pl-smi">T</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">width</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span>, <span class="pl-c1">T</span><span class="pl-c1">*</span> <span class="pl-s1">grad_input</span>, <span class="pl-s1">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">rois</span>) { <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">index</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">nthreads</span>; <span class="pl-s1">index</span><span class="pl-c1">++</span>) { <span class="pl-smi">int</span> <span class="pl-s1">pw</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span> % <span class="pl-s1">pooled_width</span>; <span class="pl-smi">int</span> <span class="pl-s1">ph</span> <span class="pl-c1">=</span> (<span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span>) % <span class="pl-s1">pooled_height</span>; <span class="pl-smi">int</span> <span class="pl-s1">n</span> <span class="pl-c1">=</span> <span class="pl-s1">index</span> / <span class="pl-s1">pooled_width</span> / <span class="pl-s1">pooled_height</span> / <span class="pl-s1">channels_out</span>; <span class="pl-k">const</span> <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">offset_rois</span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span> <span class="pl-c1">+</span> <span class="pl-s1">n</span> <span class="pl-c1">*</span> <span class="pl-c1">5</span>; <span class="pl-smi">int</span> <span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">0</span>]; <span class="pl-c">// Do not using rounding; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">roi_start_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">1</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_start_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">2</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">3</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-smi">T</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">=</span> <span class="pl-s1">offset_rois</span>[<span class="pl-c1">4</span>] <span class="pl-c1">*</span> <span class="pl-s1">spatial_scale</span> <span class="pl-c1">-</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-c1">0.5</span>); <span class="pl-c">// Force too small ROIs to be 1x1</span> <span class="pl-smi">T</span> <span class="pl-s1">roi_width</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_w</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-smi">T</span> <span class="pl-s1">roi_height</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_end_h</span> <span class="pl-c1">-</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_height</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_height</span>); <span class="pl-smi">T</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_width</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pooled_width</span>); <span class="pl-smi">int</span> <span class="pl-s1">c_in</span> <span class="pl-c1">=</span> <span class="pl-s1">channel_mapping</span>[<span class="pl-s1">index</span>]; <span class="pl-smi">T</span><span class="pl-c1">*</span> <span class="pl-s1">grad_input_offset</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_input</span> <span class="pl-c1">+</span> (<span class="pl-s1">roi_batch_ind</span> <span class="pl-c1">*</span> <span class="pl-s1">channels</span> <span class="pl-c1">+</span> <span class="pl-s1">c_in</span>) <span class="pl-c1">*</span> <span class="pl-s1">height</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span>; <span class="pl-c">// Do not using floor/ceil; this implementation detail is critical</span> <span class="pl-smi">T</span> <span class="pl-s1">hstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ph</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_h</span>; <span class="pl-smi">T</span> <span class="pl-s1">wstart</span> <span class="pl-c1">=</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">pw</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> <span class="pl-c1">+</span> <span class="pl-s1">roi_start_w</span>; <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output</span>[<span class="pl-s1">index</span>]; <span class="pl-c">// We use roi_bin_grid to sample the grid and mimic integral</span> <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_height</span> / <span class="pl-s1">pooled_height</span>); <span class="pl-c">// e.g., = 2</span> <span class="pl-smi">int</span> <span class="pl-s1">roi_bin_grid_w</span> <span class="pl-c1">=</span> (<span class="pl-s1">sampling_ratio</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>) ? <span class="pl-s1">sampling_ratio</span> : <span class="pl-en">ceil</span>(<span class="pl-s1">roi_width</span> / <span class="pl-s1">pooled_width</span>); <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> <span class="pl-s1">roi_bin_grid_h</span> <span class="pl-c1">*</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">iy</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">iy</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_h</span>; <span class="pl-s1">iy</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">hstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">iy</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_h</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_h</span>); <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">ix</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>; <span class="pl-s1">ix</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">roi_bin_grid_w</span>; <span class="pl-s1">ix</span><span class="pl-c1">++</span>) { <span class="pl-k">const</span> <span class="pl-smi">T</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">wstart</span> <span class="pl-c1">+</span> <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">ix</span> <span class="pl-c1">+</span> <span class="pl-c1">.5f</span>) <span class="pl-c1">*</span> <span class="pl-s1">bin_size_w</span> / <span class="pl-s1">static_cast</span><span class="pl-c1">&lt;</span><span class="pl-c1">T</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">roi_bin_grid_w</span>); <span class="pl-smi">T</span> <span class="pl-s1">w1</span>, <span class="pl-s1">w2</span>, <span class="pl-s1">w3</span>, <span class="pl-s1">w4</span>; <span class="pl-smi">int</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">x_high</span>, <span class="pl-s1">y_low</span>, <span class="pl-s1">y_high</span>; <span class="pl-en">bilinear_interpolate_gradient</span>( <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">y</span>, <span class="pl-s1">x</span>, <span class="pl-s1">w1</span>, <span class="pl-s1">w2</span>, <span class="pl-s1">w3</span>, <span class="pl-s1">w4</span>, <span class="pl-s1">x_low</span>, <span class="pl-s1">x_high</span>, <span class="pl-s1">y_low</span>, <span class="pl-s1">y_high</span>, <span class="pl-s1">index</span>); <span class="pl-smi">T</span> <span class="pl-s1">g1</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w1</span> / <span class="pl-s1">count</span>; <span class="pl-smi">T</span> <span class="pl-s1">g2</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w2</span> / <span class="pl-s1">count</span>; <span class="pl-smi">T</span> <span class="pl-s1">g3</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w3</span> / <span class="pl-s1">count</span>; <span class="pl-smi">T</span> <span class="pl-s1">g4</span> <span class="pl-c1">=</span> <span class="pl-s1">grad_output_this_bin</span> <span class="pl-c1">*</span> <span class="pl-s1">w4</span> / <span class="pl-s1">count</span>; <span class="pl-k">if</span> (<span class="pl-s1">x_low</span> &gt;= <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">x_high</span> &gt;= <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">y_low</span> &gt;= <span class="pl-c1">0</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">y_high</span> &gt;= <span class="pl-c1">0</span>) { <span class="pl-en">add</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">g1</span>); <span class="pl-en">add</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_low</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>, <span class="pl-s1">g2</span>); <span class="pl-en">add</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_low</span>, <span class="pl-s1">g3</span>); <span class="pl-en">add</span>(<span class="pl-s1">grad_input_offset</span> <span class="pl-c1">+</span> <span class="pl-s1">y_high</span> <span class="pl-c1">*</span> <span class="pl-s1">width</span> <span class="pl-c1">+</span> <span class="pl-s1">x_high</span>, <span class="pl-s1">g4</span>); } <span class="pl-c">// if</span> } <span class="pl-c">// ix</span> } <span class="pl-c">// iy</span> } } <span class="pl-ent">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span>, <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span> <span class="pl-en">PSROIAlign_forward_cpu</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>) { <span class="pl-c">// Check if input tensors are CPU tensors</span> <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">input</span>.<span class="pl-en">device</span>().<span class="pl-en">is_cpu</span>(), <span class="pl-s">"input must be a CPU tensor"</span>); <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">rois</span>.<span class="pl-en">device</span>().<span class="pl-en">is_cpu</span>(), <span class="pl-s">"rois must be a CPU tensor"</span>); <span class="pl-s1">at</span>::<span class="pl-s1">TensorArg</span> <span class="pl-s1">input_t</span>{<span class="pl-s1">input</span>, <span class="pl-s">"input"</span>, <span class="pl-c1">1</span>}, <span class="pl-s1">rois_t</span>{<span class="pl-s1">rois</span>, <span class="pl-s">"rois"</span>, <span class="pl-c1">2</span>}; <span class="pl-ent">at</span>::<span class="pl-s1">CheckedFrom</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s">"PSROIAlign_forward_cpu"</span>; <span class="pl-ent">at</span>::<span class="pl-s1">checkAllSameType</span>(<span class="pl-s1">c</span>, {<span class="pl-s1">input_t</span>, <span class="pl-s1">rois_t</span>}); <span class="pl-smi">int</span> <span class="pl-s1">num_rois</span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span>.<span class="pl-en">size</span>(<span class="pl-c1">0</span>); <span class="pl-smi">int</span> <span class="pl-s1">channels</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">size</span>(<span class="pl-c1">1</span>); <span class="pl-smi">int</span> <span class="pl-s1">height</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">size</span>(<span class="pl-c1">2</span>); <span class="pl-smi">int</span> <span class="pl-s1">width</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">size</span>(<span class="pl-c1">3</span>); <span class="pl-en">AT_ASSERTM</span>( <span class="pl-s1">channels</span> % (<span class="pl-s1">pooled_height</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span>) <span class="pl-c1">==</span> <span class="pl-c1">0</span>, <span class="pl-s">"input channels must be a multiple of pooling height * pooling width"</span>); <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span> <span class="pl-c1">=</span> <span class="pl-s1">channels</span> / (<span class="pl-s1">pooled_height</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span>); auto <span class="pl-smi">output</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-en">zeros</span>( {<span class="pl-smi">num_rois</span>, <span class="pl-smi">channels_out</span>, <span class="pl-smi">pooled_height</span>, <span class="pl-smi">pooled_width</span>}, <span class="pl-smi">input</span>.<span class="pl-en">options</span>()); auto <span class="pl-smi">channel_mapping</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-en">zeros</span>(<span class="pl-smi">output</span>.<span class="pl-en">sizes</span>(), <span class="pl-smi">input</span>.<span class="pl-en">options</span>().<span class="pl-en">dtype</span>(<span class="pl-smi">at</span>::<span class="pl-s1">kInt</span>)); auto <span class="pl-smi">output_size</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">output</span>.<span class="pl-en">numel</span>(); <span class="pl-k">if</span> (<span class="pl-s1">output_size</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span>) { <span class="pl-k">return</span> <span class="pl-s1">std</span>::<span class="pl-en">make_tuple</span>(<span class="pl-s1">output</span>, <span class="pl-s1">channel_mapping</span>); } <span class="pl-en">AT_DISPATCH_FLOATING_TYPES_AND_HALF</span>( <span class="pl-s1">input</span>.<span class="pl-en">scalar_type</span>(), <span class="pl-s">"PSROIAlign_forward"</span>, [<span class="pl-c1">&amp;</span>] { <span class="pl-s1">PSROIAlignForwardCPU</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>( <span class="pl-s1">output_size</span>, <span class="pl-s1">input</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">channels</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">rois</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">channels_out</span>, <span class="pl-s1">output</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">channel_mapping</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">int</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>)); }); <span class="pl-k">return</span> <span class="pl-s1">std</span>::<span class="pl-en">make_tuple</span>(<span class="pl-s1">output</span>, <span class="pl-s1">channel_mapping</span>); } <span class="pl-ent">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-en">PSROIAlign_backward_cpu</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">grad</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">channel_mapping</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">batch_size</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">width</span>) { <span class="pl-c">// Check if input tensors are CPU tensors</span> <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">grad</span>.<span class="pl-en">device</span>().<span class="pl-en">is_cpu</span>(), <span class="pl-s">"grad must be a CPU tensor"</span>); <span class="pl-en">AT_ASSERTM</span>(<span class="pl-s1">rois</span>.<span class="pl-en">device</span>().<span class="pl-en">is_cpu</span>(), <span class="pl-s">"rois must be a CPU tensor"</span>); <span class="pl-en">AT_ASSERTM</span>( <span class="pl-s1">channel_mapping</span>.<span class="pl-en">device</span>().<span class="pl-en">is_cpu</span>(), <span class="pl-s">"channel_mapping must be a CPU tensor"</span>); <span class="pl-s1">at</span>::<span class="pl-s1">TensorArg</span> <span class="pl-s1">grad_t</span>{<span class="pl-s1">grad</span>, <span class="pl-s">"grad"</span>, <span class="pl-c1">1</span>}, <span class="pl-s1">rois_t</span>{<span class="pl-s1">rois</span>, <span class="pl-s">"rois"</span>, <span class="pl-c1">2</span>}, <span class="pl-s1">channel_mapping_t</span>{<span class="pl-s1">channel_mapping</span>, <span class="pl-s">"channel_mapping"</span>, <span class="pl-c1">3</span>}; <span class="pl-ent">at</span>::<span class="pl-s1">CheckedFrom</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-s">"PSROIAlign_backward_cpu"</span>; <span class="pl-ent">at</span>::<span class="pl-s1">checkAllSameType</span>(<span class="pl-s1">c</span>, {<span class="pl-s1">grad_t</span>, <span class="pl-s1">rois_t</span>}); auto <span class="pl-smi">num_rois</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">rois</span>.<span class="pl-en">size</span>(<span class="pl-c1">0</span>); auto <span class="pl-smi">grad_input</span> <span class="pl-c1">=</span> <span class="pl-s1">at</span>::<span class="pl-en">zeros</span>({<span class="pl-smi">batch_size</span>, <span class="pl-smi">channels</span>, <span class="pl-smi">height</span>, <span class="pl-smi">width</span>}, <span class="pl-smi">grad</span>.<span class="pl-en">options</span>()); <span class="pl-c">// handle possibly empty gradients</span> <span class="pl-k">if</span> (<span class="pl-s1">grad</span>.<span class="pl-en">numel</span>() <span class="pl-c1">==</span> <span class="pl-c1">0</span>) { <span class="pl-k">return</span> <span class="pl-s1">grad_input</span>; } <span class="pl-smi">int</span> <span class="pl-s1">channels_out</span> <span class="pl-c1">=</span> <span class="pl-s1">channels</span> / (<span class="pl-s1">pooled_height</span> <span class="pl-c1">*</span> <span class="pl-s1">pooled_width</span>); <span class="pl-en">AT_DISPATCH_FLOATING_TYPES_AND_HALF</span>( <span class="pl-s1">grad</span>.<span class="pl-en">scalar_type</span>(), <span class="pl-s">"PSROIAlign_backward"</span>, [<span class="pl-c1">&amp;</span>] { <span class="pl-s1">PSROIAlignBackwardCPU</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>( <span class="pl-s1">grad</span>.<span class="pl-en">numel</span>(), <span class="pl-s1">grad</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">channel_mapping</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">int</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">num_rois</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">channels</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">channels_out</span>, <span class="pl-s1">grad_input</span>.<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>), <span class="pl-s1">rois</span>.<span class="pl-en">contiguous</span>().<span class="pl-c1">data_ptr</span><span class="pl-c1">&lt;</span><span class="pl-s1">scalar_t</span><span class="pl-c1">&gt;</span>(<span class="pl-s1"></span>)); }); <span class="pl-k">return</span> <span class="pl-s1">grad_input</span>; }</pre></div> </details> <details> <summary> PSROIAlign.h </summary> <div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#pragma once #include &quot;torch/torch.h&quot; #include &quot;PSROIAlign_cuda.h&quot; #include &lt;iostream&gt; std::tuple&lt;at::Tensor, at::Tensor&gt; PSROIAlign_forward_cpu( const at::Tensor &amp; input, const at::Tensor &amp; rois, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio); at::Tensor PSROIAlign_backward_cpu( const at::Tensor &amp; grad, const at::Tensor &amp; rois, const at::Tensor &amp; mapping_channel, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio, const int batch_size, const int channels, const int height, const int width); std::tuple&lt;at::Tensor, at::Tensor&gt; PSROIAlign_forward( const at::Tensor&amp; input, const at::Tensor&amp; rois, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio) { if (input.type().is_cuda()) { return PSROIAlign_forward_cuda( input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio); } return PSROIAlign_forward_cpu( input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio); } at::Tensor PSROIAlign_backward( const at::Tensor&amp; grad, const at::Tensor&amp; rois, const at::Tensor&amp; mapping_channel, const float spatial_scale, const int pooled_height, const int pooled_width, const int sampling_ratio, const int batch_size, const int channels, const int height, const int width) { if (grad.type().is_cuda()) { return PSROIAlign_backward_cuda( grad, rois, mapping_channel, spatial_scale, pooled_height, pooled_width, sampling_ratio, batch_size, channels, height, width); } return PSROIAlign_backward_cpu( grad, rois, mapping_channel, spatial_scale, pooled_height, pooled_width, sampling_ratio, batch_size, channels, height, width); } using namespace at; using torch::Tensor; using torch::autograd::AutogradContext; using torch::autograd::Variable; using torch::autograd::variable_list; class PSROIAlignFunction : public torch::autograd::Function&lt;PSROIAlignFunction&gt; { public: static variable_list forward( AutogradContext* ctx, Variable input, Variable rois, const double spatial_scale, const int64_t pooled_height, const int64_t pooled_width, const int64_t sampling_ratio) { ctx-&gt;saved_data[&quot;spatial_scale&quot;] = spatial_scale; ctx-&gt;saved_data[&quot;pooled_height&quot;] = pooled_height; ctx-&gt;saved_data[&quot;pooled_width&quot;] = pooled_width; ctx-&gt;saved_data[&quot;sampling_ratio&quot;] = sampling_ratio; ctx-&gt;saved_data[&quot;input_shape&quot;] = input.sizes(); auto result = PSROIAlign_forward( input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio); auto output = std::get&lt;0&gt;(result); auto channel_mapping = std::get&lt;1&gt;(result); ctx-&gt;save_for_backward({rois, channel_mapping}); ctx-&gt;mark_non_differentiable({channel_mapping}); return {output, channel_mapping}; } static variable_list backward( AutogradContext* ctx, variable_list grad_output) { // Use data saved in forward auto saved = ctx-&gt;get_saved_variables(); auto rois = saved[0]; auto channel_mapping = saved[1]; auto input_shape = ctx-&gt;saved_data[&quot;input_shape&quot;].toIntList(); auto grad_in = PSROIAlign_backward( grad_output[0], rois, channel_mapping, ctx-&gt;saved_data[&quot;spatial_scale&quot;].toDouble(), ctx-&gt;saved_data[&quot;pooled_height&quot;].toInt(), ctx-&gt;saved_data[&quot;pooled_width&quot;].toInt(), ctx-&gt;saved_data[&quot;sampling_ratio&quot;].toInt(), input_shape[0], input_shape[1], input_shape[2], input_shape[3]); return { grad_in, Variable(), Variable(), Variable(), Variable(), Variable()}; } }; std::tuple&lt;Tensor, Tensor&gt; ps_roi_align( const Tensor&amp; input, const torch::Tensor&amp; rois, const double spatial_scale, const int64_t pooled_height, const int64_t pooled_width, const int64_t sampling_ratio) { auto result = PSROIAlignFunction::apply( input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio); return std::tuple&lt;Tensor, Tensor&gt;(result[0], result[1]); }"><pre class="notranslate"><span class="pl-k">#pragma</span> once <span class="pl-k">#include</span> <span class="pl-s">"torch/torch.h"</span> <span class="pl-k">#include</span> <span class="pl-s">"PSROIAlign_cuda.h"</span> <span class="pl-k">#include</span> <span class="pl-s">&lt;iostream&gt;</span> <span class="pl-ent">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span>, <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span> <span class="pl-en">PSROIAlign_forward_cpu</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-c1">&amp;</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>); <span class="pl-ent">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-en">PSROIAlign_backward_cpu</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-c1">&amp;</span> <span class="pl-s1">grad</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-c1">&amp;</span> <span class="pl-s1">mapping_channel</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">batch_size</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">width</span>); <span class="pl-ent">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span>, <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span> <span class="pl-en">PSROIAlign_forward</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>) { <span class="pl-k">if</span> (<span class="pl-s1">input</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>()) { <span class="pl-k">return</span> <span class="pl-en">PSROIAlign_forward_cuda</span>( <span class="pl-s1">input</span>, <span class="pl-s1">rois</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>); } <span class="pl-k">return</span> <span class="pl-en">PSROIAlign_forward_cpu</span>( <span class="pl-s1">input</span>, <span class="pl-s1">rois</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>); } <span class="pl-ent">at</span>::<span class="pl-s1">Tensor</span> <span class="pl-en">PSROIAlign_backward</span>( <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">grad</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">at</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">mapping_channel</span>, <span class="pl-s1">const</span> <span class="pl-s1">float</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">batch_size</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">channels</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int</span> <span class="pl-s1">width</span>) { <span class="pl-k">if</span> (<span class="pl-s1">grad</span>.<span class="pl-en">type</span>().<span class="pl-en">is_cuda</span>()) { <span class="pl-k">return</span> <span class="pl-en">PSROIAlign_backward_cuda</span>( <span class="pl-s1">grad</span>, <span class="pl-s1">rois</span>, <span class="pl-s1">mapping_channel</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">batch_size</span>, <span class="pl-s1">channels</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>); } <span class="pl-k">return</span> <span class="pl-en">PSROIAlign_backward_cpu</span>( <span class="pl-s1">grad</span>, <span class="pl-s1">rois</span>, <span class="pl-s1">mapping_channel</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>, <span class="pl-s1">batch_size</span>, <span class="pl-s1">channels</span>, <span class="pl-s1">height</span>, <span class="pl-s1">width</span>); } <span class="pl-smi">using</span> <span class="pl-s1">namespace</span> <span class="pl-s1">at</span>; <span class="pl-smi">using</span> <span class="pl-s1">torch</span>::<span class="pl-s1">Tensor</span>; <span class="pl-smi">using</span> <span class="pl-s1">torch</span>::<span class="pl-s1">autograd</span>::<span class="pl-s1">AutogradContext</span>; <span class="pl-smi">using</span> <span class="pl-s1">torch</span>::<span class="pl-s1">autograd</span>::<span class="pl-s1">Variable</span>; <span class="pl-smi">using</span> <span class="pl-s1">torch</span>::<span class="pl-s1">autograd</span>::<span class="pl-s1">variable_list</span>; <span class="pl-smi">class</span> <span class="pl-s1">PSROIAlignFunction</span> : <span class="pl-s1">public</span> <span class="pl-s1">torch</span>::<span class="pl-s1">autograd</span>::<span class="pl-s1">Function</span><span class="pl-c1">&lt;</span><span class="pl-s1">PSROIAlignFunction</span><span class="pl-c1">&gt;</span> { <span class="pl-ent">public</span>: <span class="pl-s1">static</span> <span class="pl-smi">variable_list</span> <span class="pl-en">forward</span>( <span class="pl-smi">AutogradContext</span><span class="pl-c1">*</span> <span class="pl-s1">ctx</span>, <span class="pl-smi">Variable</span> <span class="pl-s1">input</span>, <span class="pl-smi">Variable</span> <span class="pl-s1">rois</span>, <span class="pl-k">const</span> <span class="pl-smi">double</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-k">const</span> <span class="pl-smi">int64_t</span> <span class="pl-s1">pooled_height</span>, <span class="pl-k">const</span> <span class="pl-smi">int64_t</span> <span class="pl-s1">pooled_width</span>, <span class="pl-k">const</span> <span class="pl-smi">int64_t</span> <span class="pl-s1">sampling_ratio</span>) { <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"spatial_scale"</span>] <span class="pl-c1">=</span> <span class="pl-s1">spatial_scale</span>; <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"pooled_height"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pooled_height</span>; <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"pooled_width"</span>] <span class="pl-c1">=</span> <span class="pl-s1">pooled_width</span>; <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"sampling_ratio"</span>] <span class="pl-c1">=</span> <span class="pl-s1">sampling_ratio</span>; <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"input_shape"</span>] <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">sizes</span>(); auto <span class="pl-smi">result</span> <span class="pl-c1">=</span> <span class="pl-en">PSROIAlign_forward</span>( <span class="pl-smi">input</span>, <span class="pl-smi">rois</span>, <span class="pl-smi">spatial_scale</span>, <span class="pl-smi">pooled_height</span>, <span class="pl-smi">pooled_width</span>, <span class="pl-smi">sampling_ratio</span>); auto <span class="pl-smi">output</span> <span class="pl-c1">=</span> <span class="pl-s1">std</span>::<span class="pl-s1">get</span><span class="pl-c1">&lt;</span><span class="pl-c1">0</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">result</span>); auto <span class="pl-smi">channel_mapping</span> <span class="pl-c1">=</span> <span class="pl-s1">std</span>::<span class="pl-s1">get</span><span class="pl-c1">&lt;</span><span class="pl-c1">1</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">result</span>); <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-en">save_for_backward</span>({<span class="pl-s1">rois</span>, <span class="pl-s1">channel_mapping</span>}); <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-en">mark_non_differentiable</span>({<span class="pl-s1">channel_mapping</span>}); <span class="pl-k">return</span> {<span class="pl-s1">output</span>, <span class="pl-s1">channel_mapping</span>}; } <span class="pl-k">static</span> <span class="pl-smi">variable_list</span> <span class="pl-en">backward</span>( <span class="pl-smi">AutogradContext</span><span class="pl-c1">*</span> <span class="pl-s1">ctx</span>, <span class="pl-smi">variable_list</span> <span class="pl-s1">grad_output</span>) { <span class="pl-c">// Use data saved in forward</span> auto <span class="pl-smi">saved</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-en">get_saved_variables</span>(); auto <span class="pl-smi">rois</span> <span class="pl-c1">=</span> <span class="pl-s1">saved</span>[<span class="pl-c1">0</span>]; auto <span class="pl-smi">channel_mapping</span> <span class="pl-c1">=</span> <span class="pl-s1">saved</span>[<span class="pl-c1">1</span>]; auto <span class="pl-smi">input_shape</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"input_shape"</span>].<span class="pl-en">toIntList</span>(); auto <span class="pl-smi">grad_in</span><span class="pl-s1"></span> <span class="pl-c1">=</span> <span class="pl-en">PSROIAlign_backward</span>( <span class="pl-s1">grad_output</span>[<span class="pl-c1">0</span>], <span class="pl-s1">rois</span>, <span class="pl-s1">channel_mapping</span>, <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"spatial_scale"</span>].<span class="pl-en">toDouble</span>(), <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"pooled_height"</span>].<span class="pl-en">toInt</span>(), <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"pooled_width"</span>].<span class="pl-en">toInt</span>(), <span class="pl-s1">ctx</span><span class="pl-c1">-&gt;</span><span class="pl-c1">saved_data</span>[<span class="pl-s">"sampling_ratio"</span>].<span class="pl-en">toInt</span>(), <span class="pl-s1">input_shape</span>[<span class="pl-c1">0</span>], <span class="pl-s1">input_shape</span>[<span class="pl-c1">1</span>], <span class="pl-s1">input_shape</span>[<span class="pl-c1">2</span>], <span class="pl-s1">input_shape</span>[<span class="pl-c1">3</span>]); <span class="pl-k">return</span> { <span class="pl-s1">grad_in</span>, <span class="pl-en">Variable</span>(), <span class="pl-en">Variable</span>(), <span class="pl-en">Variable</span>(), <span class="pl-en">Variable</span>(), <span class="pl-en">Variable</span>()}; } }; <span class="pl-smi">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">Tensor</span>, <span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span> <span class="pl-en">ps_roi_align</span>( <span class="pl-s1">const</span> <span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">input</span>, <span class="pl-s1">const</span> <span class="pl-s1">torch</span>::<span class="pl-s1">Tensor</span><span class="pl-c1">&amp;</span> <span class="pl-s1">rois</span>, <span class="pl-s1">const</span> <span class="pl-s1">double</span> <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">const</span> <span class="pl-s1">int64_t</span> <span class="pl-s1">pooled_height</span>, <span class="pl-s1">const</span> <span class="pl-s1">int64_t</span> <span class="pl-s1">pooled_width</span>, <span class="pl-s1">const</span> <span class="pl-s1">int64_t</span> <span class="pl-s1">sampling_ratio</span>) { auto <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">PSROIAlignFunction</span>::<span class="pl-en">apply</span>( <span class="pl-s1">input</span>, <span class="pl-s1">rois</span>, <span class="pl-s1">spatial_scale</span>, <span class="pl-s1">pooled_height</span>, <span class="pl-s1">pooled_width</span>, <span class="pl-s1">sampling_ratio</span>); <span class="pl-k">return</span> <span class="pl-s1">std</span>::<span class="pl-s1">tuple</span><span class="pl-c1">&lt;</span><span class="pl-s1">Tensor</span>, <span class="pl-s1">Tensor</span><span class="pl-c1">&gt;</span>(<span class="pl-s1">result</span>[<span class="pl-c1">0</span>], <span class="pl-s1">result</span>[<span class="pl-c1">1</span>]); }</pre></div> </details> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/suo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/suo">@suo</a></p>
1
<p dir="auto">Hello,</p> <p dir="auto">Alt + ] or AltGr + ] not working in AZERTY(FR) keyboard please fix or help :'(.</p> <p dir="auto">Thanks ! ;)</p>
<p dir="auto">Original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28529842" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/1625" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/1625/hovercard" href="https://github.com/atom/atom/issues/1625">atom/atom#1625</a></p> <hr> <p dir="auto">Use <a href="https://atom.io/packages/keyboard-localization" rel="nofollow">https://atom.io/packages/keyboard-localization</a> until this issue gets fixed (should be in the Blink upstream).</p>
1
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=snicoll" rel="nofollow">Stéphane Nicoll</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7630?redirect=false" rel="nofollow">SPR-7630</a></strong> and commented</p> <p dir="auto">While migrating our app from 2.5.7 to 3.0.4 we have noticed a major slowdown in the application context's startup.</p> <p dir="auto">Our application is using Spring Batch and has 22 batches. I have ran a profiling session and noticed an <em>abusive</em> call to <code class="notranslate">java.lang.Class.getMethod(String, Class[])</code>.</p> <p dir="auto">The culprit seems to be a change in <code class="notranslate">AnnotationUtils.findAnnotation(Method,Class)</code>.</p> <p dir="auto">Attached the back trace calls for both Spring 2.5 and 3.0.4. The only thing that changed between the profiling sessions is the Spring version and the profiler only starts the (same) application context.</p> <p dir="auto">I also have the yourkit snapshots if you are interested to run a snapshot comparison.</p> <p dir="auto">This is obviously blocking us to upgrade. Let me know if there anything I can do to help.</p> <hr> <p dir="auto"><strong>Affects:</strong> 3.0.4</p> <p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?p=323388#post323388" rel="nofollow">http://forum.springsource.org/showthread.php?p=323388#post323388</a></p> <p dir="auto"><strong>Attachments:</strong></p> <ul dir="auto"> <li><a href="https://jira.spring.io/secure/attachment/17185/spring25-batch-register-step-listeners-call-stack.png" rel="nofollow">spring25-batch-register-step-listeners-call-stack.png</a> (<em>108.12 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17178/spring25-getMethod.png" rel="nofollow">spring25-getMethod.png</a> (<em>19.30 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17186/spring25-register-item-listeners-call-stack.png" rel="nofollow">spring25-register-item-listeners-call-stack.png</a> (<em>91.53 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17187/spring-3.0.4.xls" rel="nofollow">spring-3.0.4.xls</a> (<em>594.00 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17198/spring-3.0.5-SNAP-getMethod.PNG" rel="nofollow">spring-3.0.5-SNAP-getMethod.PNG</a> (<em>16.06 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17197/spring-3.0.5-SNAP-register-item-listeners-call-stack.png" rel="nofollow">spring-3.0.5-SNAP-register-item-listeners-call-stack.png</a> (<em>46.23 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17177/spring3-getMethod.png" rel="nofollow">spring3-getMethod.png</a> (<em>59.53 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17183/spring3-register-item-listeners-call-stack.png" rel="nofollow">spring3-register-item-listeners-call-stack.png</a> (<em>67.84 kB</em>)</li> <li><a href="https://jira.spring.io/secure/attachment/17184/spring3-register-step-listeners-call-stack.png" rel="nofollow">spring3-register-step-listeners-call-stack.png</a> (<em>66.47 kB</em>)</li> </ul> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398169037" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/16501" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/16501/hovercard" href="https://github.com/spring-projects/spring-framework/issues/16501">#16501</a> ReflectionUtils slow down application startup on WebSphere</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398225601" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/21216" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/21216/hovercard" href="https://github.com/spring-projects/spring-framework/issues/21216">#21216</a> Comprehensively cache annotated methods for interfaces and superclasses</li> </ul> <p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/3c067e5db6309964d33b14924afbba039ad7e62b/hovercard" href="https://github.com/spring-projects/spring-framework/commit/3c067e5db6309964d33b14924afbba039ad7e62b"><tt>3c067e5</tt></a></p> <p dir="auto">1 votes, 5 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=olivergierke" rel="nofollow">Oliver Drotbohm</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8880?redirect=false" rel="nofollow">SPR-8880</a></strong> and commented</p> <p dir="auto">Suppose you have an application with a base package of <code class="notranslate">com.acme</code> with an <code class="notranslate">@Configuration</code> class located in this package. Now suppose you use this configuration class as <code class="notranslate">basePackageClass</code> inside <code class="notranslate">@ComponentScan</code>. This will result in an exception saying the class is registered twice. So you pretty much end up with always adding this exclude.</p> <p dir="auto">Would it make sense to default the <code class="notranslate">excludeFilters</code> attribute of the <code class="notranslate">@ComponentScan</code> annotation as follows?</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Filter(type = FilterType.ANNOTATION, value = Configuration.class)"><pre class="notranslate"><code class="notranslate">@Filter(type = FilterType.ANNOTATION, value = Configuration.class) </code></pre></div> <hr> <p dir="auto"><strong>Affects:</strong> 3.1 RC2</p> <p dir="auto"><strong>Issue Links:</strong></p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398115308" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13450" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13450/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13450">#13450</a> Allow <code class="notranslate">@Configuration</code> classes to self-<code class="notranslate">@ComponentScan</code> (<em><strong>"duplicates"</strong></em>)</li> </ul>
0
<p dir="auto">Series.map works when passed a dict, but Index.map doesn't:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; s = pd.Series(['a', 'b', 'c', 'd'], index=['a', 'b', 'c', 'd']) &gt;&gt;&gt; d = {'a': 0, 'b': 1, 'c': 2, 'd': 3} &gt;&gt;&gt; s.map(d) a 0 b 1 c 2 d 3 dtype: int64 &gt;&gt;&gt; s.index.map(d) Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;/home/evanpw/Workspace/pandas/pandas/indexes/base.py&quot;, line 2305, in map return self._arrmap(self.values, mapper) File &quot;pandas/src/generated.pyx&quot;, line 2356, in pandas.algos.arrmap_object (pandas/algos.c:70221) TypeError: 'dict' object is not callable"><pre lang=".python" class="notranslate"><code class="notranslate">&gt;&gt;&gt; s = pd.Series(['a', 'b', 'c', 'd'], index=['a', 'b', 'c', 'd']) &gt;&gt;&gt; d = {'a': 0, 'b': 1, 'c': 2, 'd': 3} &gt;&gt;&gt; s.map(d) a 0 b 1 c 2 d 3 dtype: int64 &gt;&gt;&gt; s.index.map(d) Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/home/evanpw/Workspace/pandas/pandas/indexes/base.py", line 2305, in map return self._arrmap(self.values, mapper) File "pandas/src/generated.pyx", line 2356, in pandas.algos.arrmap_object (pandas/algos.c:70221) TypeError: 'dict' object is not callable </code></pre></div> <p dir="auto">PR to follow shortly</p>
<p dir="auto">A DataFrame index has the map function, which expects a mapper. However, unlike mapping a Series, it only accepts callables, and won't work when mapping through dictionaries or series.</p> <h4 dir="auto">Code Sample:</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="df = pd.DataFrame({'col1': range(5)}) d = {0: 'zero', 1: 'one', 2: 'two', 3: 'three', 4: 'four'} df.col1.map(d) # perfectly valid df.index.map(d) # TypeError: 'dict' object is not callable s = pd.Series(d) df.col1.map(s) # perfectly valid df.index.map(s) # TypeError: 'Series' object is not callable"><pre class="notranslate"><span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'col1'</span>: <span class="pl-en">range</span>(<span class="pl-c1">5</span>)}) <span class="pl-s1">d</span> <span class="pl-c1">=</span> {<span class="pl-c1">0</span>: <span class="pl-s">'zero'</span>, <span class="pl-c1">1</span>: <span class="pl-s">'one'</span>, <span class="pl-c1">2</span>: <span class="pl-s">'two'</span>, <span class="pl-c1">3</span>: <span class="pl-s">'three'</span>, <span class="pl-c1">4</span>: <span class="pl-s">'four'</span>} <span class="pl-s1">df</span>.<span class="pl-s1">col1</span>.<span class="pl-en">map</span>(<span class="pl-s1">d</span>) <span class="pl-c"># perfectly valid</span> <span class="pl-s1">df</span>.<span class="pl-s1">index</span>.<span class="pl-en">map</span>(<span class="pl-s1">d</span>) <span class="pl-c"># TypeError: 'dict' object is not callable</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">d</span>) <span class="pl-s1">df</span>.<span class="pl-s1">col1</span>.<span class="pl-en">map</span>(<span class="pl-s1">s</span>) <span class="pl-c"># perfectly valid</span> <span class="pl-s1">df</span>.<span class="pl-s1">index</span>.<span class="pl-en">map</span>(<span class="pl-s1">s</span>) <span class="pl-c"># TypeError: 'Series' object is not callable</span></pre></div> <h4 dir="auto">Expected Output:</h4> <p dir="auto">I would expect the same output for <code class="notranslate">df.col1.map(s)</code> and <code class="notranslate">df.index.map(s)</code>, or at least that it returns an nparray with the mapped values, as it does when we do pass a callable, but not that it breaks like it does.</p> <h4 dir="auto">output of <code class="notranslate">pd.show_versions()</code>:</h4> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 2.7.6.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 3.16.0-67-generic<br> machine: x86_64<br> processor: x86_64<br> byteorder: little<br> LC_ALL: en_US.UTF-8<br> LANG: en_DE.UTF-8</p> <p dir="auto">pandas: 0.18.0<br> nose: 1.3.7<br> pip: 8.1.1<br> setuptools: 20.6.6<br> Cython: 0.23.5<br> numpy: 1.11.0<br> scipy: 0.17.0<br> statsmodels: 0.6.1<br> xarray: None<br> IPython: 4.1.2<br> sphinx: 1.4<br> patsy: 0.4.1<br> dateutil: 2.5.2<br> pytz: 2016.3<br> blosc: None<br> bottleneck: None<br> tables: None<br> numexpr: 2.5.1<br> matplotlib: 1.5.1<br> openpyxl: 2.3.4<br> xlrd: 0.9.4<br> xlwt: None<br> xlsxwriter: None<br> lxml: 3.6.0<br> bs4: None<br> html5lib: 0.9999999<br> httplib2: 0.9.2<br> apiclient: None<br> sqlalchemy: 1.0.12<br> pymysql: None<br> psycopg2: 2.6.1 (dt dec pq3 ext lo64)<br> jinja2: 2.8<br> boto: 2.39.0</p>
1
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="C:\Users\ry\deno&gt;python tools/setup.py binary download python C:\Users\ry\deno\third_party\depot_tools\download_from_google_storage.py --platform=win32 --no_auth --bucket=chromium-gn --sha1_file C:\Users\ry\deno\third_party\v8\buildtools\win\gn.exe.sha1 python C:\Users\ry\deno\third_party\depot_tools\download_from_google_storage.py --platform=win32 --no_auth --bucket=chromium-clang-format --sha1_file C:\Users\ry\deno\third_party\v8\buildtools\win\clang-format.exe.sha1 python C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-362913-80fee257-1.tgz .......... Done. Traceback (most recent call last): File &quot;C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py&quot;, line 324, in &lt;module&gt; sys.exit(main()) File &quot;C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py&quot;, line 320, in main return UpdateClang() File &quot;C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py&quot;, line 258, in UpdateClang CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin')) File &quot;C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py&quot;, line 229, in CopyDiaDllTo GetWinSDKDir() File &quot;C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py&quot;, line 202, in GetWinSDKDir import vs_toolchain ImportError: No module named vs_toolchain"><pre class="notranslate"><code class="notranslate">C:\Users\ry\deno&gt;python tools/setup.py binary download python C:\Users\ry\deno\third_party\depot_tools\download_from_google_storage.py --platform=win32 --no_auth --bucket=chromium-gn --sha1_file C:\Users\ry\deno\third_party\v8\buildtools\win\gn.exe.sha1 python C:\Users\ry\deno\third_party\depot_tools\download_from_google_storage.py --platform=win32 --no_auth --bucket=chromium-clang-format --sha1_file C:\Users\ry\deno\third_party\v8\buildtools\win\clang-format.exe.sha1 python C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-362913-80fee257-1.tgz .......... Done. Traceback (most recent call last): File "C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py", line 324, in &lt;module&gt; sys.exit(main()) File "C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py", line 320, in main return UpdateClang() File "C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py", line 258, in UpdateClang CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin')) File "C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py", line 229, in CopyDiaDllTo GetWinSDKDir() File "C:\Users\ry\deno\third_party\v8\tools\clang\scripts\update.py", line 202, in GetWinSDKDir import vs_toolchain ImportError: No module named vs_toolchain </code></pre></div>
<p dir="auto">I've followed the manual : <a href="https://deno.land/manual.html#buildfromsource" rel="nofollow">https://deno.land/manual.html#buildfromsource</a></p> <p dir="auto">And i've the error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" GetWinSDKDir import vs_toolchain ImportError: No module named vs_toolchain"><pre class="notranslate"><code class="notranslate"> GetWinSDKDir import vs_toolchain ImportError: No module named vs_toolchain </code></pre></div> <p dir="auto">After checking in <a href="https://github.com/denoland/deno/blob/master/.appveyor.yml">https://github.com/denoland/deno/blob/master/.appveyor.yml</a> i have updated my PYTHONPATH to <code class="notranslate">C:\temp\deno\third_party\python_packages</code><br> then i got:<br> <code class="notranslate">Exception: Visual Studio version 2015 (from GYP_MSVS_VERSION) not supported. Supported versions are: 2017, 2019</code><br> Problem is i have already installed nodejs before and it sets this env variable. After changing it to :<br> <code class="notranslate">GYP_MSVS_VERSION=2017</code><br> It works!<br> Maybe the documentation needs to be updated or i got a weird configuration?</p>
1
<p dir="auto">I am trying to follow the steps as per the readme file.<br> I get an import error.<br> After i inspected the repo i found that "gen_audio_ops" is missing under tensorflow/python/ops package.</p> <p dir="auto">Following is an image which shows the import<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/17523473/29909246-9f1e1b0e-8e42-11e7-8f89-d601281d38c0.png"><img src="https://user-images.githubusercontent.com/17523473/29909246-9f1e1b0e-8e42-11e7-8f89-d601281d38c0.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">Can you please help to get me the said package.</p>
<p dir="auto">I want to reuse a name scope which was created earlier with <code class="notranslate">tf.name_scope</code>. Normally, name_scope will create a new unique name in the current namespace. If it ends with "/", it will ignore the current namespace and use it as an absolute name scope but then it doesn't make it unique. I want a way that it just uses the name as I provide it in the current namespace.</p> <p dir="auto">Current code:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" @contextlib.contextmanager def name_scope(self, name): ... old_stack = self._name_stack if not name: # Both for name=None and name=&quot;&quot; we re-set to empty scope. new_stack = None elif name and name[-1] == &quot;/&quot;: new_stack = name[:-1] else: new_stack = self.unique_name(name) self._name_stack = new_stack yield &quot;&quot; if new_stack is None else new_stack + &quot;/&quot;"><pre class="notranslate"><code class="notranslate"> @contextlib.contextmanager def name_scope(self, name): ... old_stack = self._name_stack if not name: # Both for name=None and name="" we re-set to empty scope. new_stack = None elif name and name[-1] == "/": new_stack = name[:-1] else: new_stack = self.unique_name(name) self._name_stack = new_stack yield "" if new_stack is None else new_stack + "/" </code></pre></div> <p dir="auto">I suggest something like:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" @contextlib.contextmanager def name_scope(self, name, reuse=False): if reuse: new_stack = self._name_stack + &quot;/&quot; + name else: ..."><pre class="notranslate"><code class="notranslate"> @contextlib.contextmanager def name_scope(self, name, reuse=False): if reuse: new_stack = self._name_stack + "/" + name else: ... </code></pre></div>
0
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1699428/7784248/998f40d6-0191-11e5-8fd7-979b776ecb66.png"><img src="https://cloud.githubusercontent.com/assets/1699428/7784248/998f40d6-0191-11e5-8fd7-979b776ecb66.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">Ubuntu 14.04 LTS</p>
<p dir="auto">On Linux if no font is specified CJK characters will be showed as unrecognized characters, see also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="65861810" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/6214" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/6214/hovercard" href="https://github.com/atom/atom/issues/6214">atom/atom#6214</a>.</p>
1
<h4 dir="auto">Issue Description</h4> <p dir="auto">Hello, the Video Challenges are not being marked as complete. I did the first four or so of computer basics and nothing was checked. I exited the browser, tried the first one two more times and it was still not marked as complete. Then I tried the first one of JavaScript lingo, completed the quiz, but still no green check mark.</p> <h4 dir="auto">Browser Information</h4> <p dir="auto">Google Chrome, newest version<br> OS X El Capitan</p>
<p dir="auto">It's not possible to mark some Computer Basics as completed. I tried to complete them many times. No success.</p> <p dir="auto">Browser: <code class="notranslate">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36</code><br> OS: <code class="notranslate">OS X 10.11.3</code></p> <p dir="auto">Screenshot:<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/2eb0fda8c347deb70094378f53607420ad7ef556ed2784d5de31fa2963bdae54/68747470733a2f2f6d6f6e6f736e61702e636f6d2f66696c652f61476b765377464c6b536d4b586862773078443366345a5179644d55396b2e706e67"><img src="https://camo.githubusercontent.com/2eb0fda8c347deb70094378f53607420ad7ef556ed2784d5de31fa2963bdae54/68747470733a2f2f6d6f6e6f736e61702e636f6d2f66696c652f61476b765377464c6b536d4b586862773078443366345a5179644d55396b2e706e67" alt="Alt text" data-canonical-src="https://monosnap.com/file/aGkvSwFLkSmKXhbw0xD3f4ZQydMU9k.png" style="max-width: 100%;"></a></p>
1
<p dir="auto">With 3.0 I used "class="visible-xs visible-sm" to show a footer on small devices. After upgrading to 3.1 the footer wasn't shown.</p> <p dir="auto">I changed it to "class="hidden-md hidden-lg" and then it was shown again.</p> <p dir="auto">Not sure if this is/was an error in 3.0 or 3.1.</p>
<p dir="auto"><a href="https://dl.dropboxusercontent.com/u/37682778/error/index.html" rel="nofollow">https://dl.dropboxusercontent.com/u/37682778/error/index.html</a></p>
1
<p dir="auto">It would be great to be able to pass a function as the attribute value. That function should be called before showing the menu. How about that?</p>
<p dir="auto">Maybe I missunderstood something but trying to overwrite some delegates in a newly created Menu will not call my custom function:</p> <p dir="auto">menu.delegate.menuWillShow = function () {<br> console.log('MY MENU DELEGATE');<br> }</p> <p dir="auto">menu.delegate.menuWillShow(); // doesn't call my function??</p> <p dir="auto">Note that the Menu is created using remote call within a BrowserWindow.</p>
1
<p dir="auto">I'm using python shared memory from multiprocessing package to share numpy arrays between processes.<br> There is a caveat, however, that populating such objects from buffer requires duplicate copy operation.<br> np.frombuffer creates new array and there is no option to populate existing array which is linked with a shared memory buffer.<br> In result, it is required to run 2 operations: deserializing the buffer content to numpy object and the second to copy elements from that array to the one linked with shared memory.<br> I would like to propose extending np.frombuffer to take additional argument of existing numpy array that would be populated with the content instead of creating new one.</p> <h3 dir="auto">Reproducing code example:</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np from multiprocessing import shared_memory input = np.ones((1,10,10,10)) b = input.tobytes() input_shm = shared_memory.SharedMemory(create=True, size=input.nbytes) write_array = np.ndarray(input.shape, dtype=input.dtype,buffer=input_shm.buf) content = np.frombuffer(b,dtype=input.dtype).reshape(input.shape) # this is one copy extensive operation write_array[:] = content[:] # this is duplicate copy to populate shared memory buffer restored_numpy = np.ndarray(input.shape, dtype=input.dtype,buffer=input_shm.buf) # reading from shared memory is quick - attaching the memory block print(&quot;restored&quot;,restored_numpy) "><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span> <span class="pl-k">from</span> <span class="pl-s1">multiprocessing</span> <span class="pl-k">import</span> <span class="pl-s1">shared_memory</span> <span class="pl-s1">input</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">ones</span>((<span class="pl-c1">1</span>,<span class="pl-c1">10</span>,<span class="pl-c1">10</span>,<span class="pl-c1">10</span>)) <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">input</span>.<span class="pl-en">tobytes</span>() <span class="pl-s1">input_shm</span> <span class="pl-c1">=</span> <span class="pl-s1">shared_memory</span>.<span class="pl-v">SharedMemory</span>(<span class="pl-s1">create</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">size</span><span class="pl-c1">=</span><span class="pl-s1">input</span>.<span class="pl-s1">nbytes</span>) <span class="pl-s1">write_array</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">ndarray</span>(<span class="pl-s1">input</span>.<span class="pl-s1">shape</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">input</span>.<span class="pl-s1">dtype</span>,<span class="pl-s1">buffer</span><span class="pl-c1">=</span><span class="pl-s1">input_shm</span>.<span class="pl-s1">buf</span>) <span class="pl-s1">content</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">frombuffer</span>(<span class="pl-s1">b</span>,<span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">input</span>.<span class="pl-s1">dtype</span>).<span class="pl-en">reshape</span>(<span class="pl-s1">input</span>.<span class="pl-s1">shape</span>) <span class="pl-c"># this is one copy extensive operation</span> <span class="pl-s1">write_array</span>[:] <span class="pl-c1">=</span> <span class="pl-s1">content</span>[:] <span class="pl-c"># this is duplicate copy to populate shared memory buffer</span> <span class="pl-s1">restored_numpy</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">ndarray</span>(<span class="pl-s1">input</span>.<span class="pl-s1">shape</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">input</span>.<span class="pl-s1">dtype</span>,<span class="pl-s1">buffer</span><span class="pl-c1">=</span><span class="pl-s1">input_shm</span>.<span class="pl-s1">buf</span>) <span class="pl-c"># reading from shared memory is quick - attaching the memory block</span> <span class="pl-en">print</span>(<span class="pl-s">"restored"</span>,<span class="pl-s1">restored_numpy</span>)</pre></div> <p dir="auto">The desired behaviour would be like:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="np.frombuffer(b,dtype=input.dtype,target_ndarray=write_array) # deserialization and populating the shared memory buffer at one time "><pre class="notranslate"><span class="pl-s1">np</span>.<span class="pl-en">frombuffer</span>(<span class="pl-s1">b</span>,<span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">input</span>.<span class="pl-s1">dtype</span>,<span class="pl-s1">target_ndarray</span><span class="pl-c1">=</span><span class="pl-s1">write_array</span>) <span class="pl-c"># deserialization and populating the shared memory buffer at one time</span></pre></div> <h3 dir="auto">Numpy/Python version information:</h3> <p dir="auto">import sys, numpy; print(numpy.<strong>version</strong>, sys.version)<br> 1.18.1 3.8.1 (default, Jan 22 2020, 16:31:49)<br> [GCC 9.2.1 20200111 gcc-9-branch@280154]</p>
<p dir="auto">I ran into this, and the solution found on <a href="http://mail.scipy.org/pipermail/numpy-discussion/2012-November/064485.html" rel="nofollow">numpy-discussion</a> worked for me, but does<br> turn up on a search of the issues.</p> <p dir="auto">Summary:</p> <ul dir="auto"> <li>Python &lt;3.2 are compiled with VS2008 (SDK v7.0,"sdk for win7 + NET 3.5.1")</li> <li>Python 3.3 (+?) is compiled with VS2010 (SDK v7.1, "sdk for win7 + NET 4")</li> <li>It's often recommended that c extensions (such as numpy) be compiled using the same compiler<br> used to compile the python binaries, to ensure CRT compatability, so using VS2010/SDK 7.1 to compile<br> numpy for python 3.3 is implied.</li> <li>VS2010 (msvc10) behaves differently with regards to manifest files then VS2008 (msvc9) but the cpython distutils, which the numpy build process relies on,<br> have not been altered to allow for this (as of python 3.3.3).</li> <li>a <a href="http://bugs.python.org/issue16296" rel="nofollow">cpython issue</a> was filed in dec/2012, but has stalled.</li> <li>The issue manifests as a "broken toolchain" exception when attempting to build<br> numpy (both 1.7.1 and 1.8.0), which results from the following compiler error message.</li> </ul> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Found executable C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe _configtest.exe.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified."><pre class="notranslate"><code class="notranslate">Found executable C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe _configtest.exe.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. </code></pre></div> <p dir="auto">The fix suggested by Christoph Gohlke on the ml is to edit the file <a href="https://github.com/akheron/cpython/blob/157e2d3078abe02576dd8710a8a4104dd620ccbe/Lib/distutils/msvc9compiler.py#L648">"Lib/distutils/msvc9compiler.py:648"</a>, Located under your python 3.3 install directory, and modify the line from:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mfinfo = self.manifest_get_embed_info(target_desc, ld_args)"><pre class="notranslate"><code class="notranslate">mfinfo = self.manifest_get_embed_info(target_desc, ld_args) </code></pre></div> <p dir="auto">to</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mfinfo = None"><pre class="notranslate"><code class="notranslate">mfinfo = None </code></pre></div> <p dir="auto">I've tried, and it has worked for me. Thanks goes to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cgohlke/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cgohlke">@cgohlke</a>, the intrepid crusader for windows pydata binaries.</p> <p dir="auto">There, that should give pagerank something to chew on.</p>
0
<p dir="auto">Hey all,</p> <p dir="auto">So I believe the github wiki is the first main source of info for new developers to the repo. As far as I'm aware, only collaborators can update it. It may be an idea to create a new section in the docs instead of using the github wiki. Perhaps putting <code class="notranslate">contributors</code> under the <code class="notranslate">Code</code> section of the <a href="https://threejs.org/" rel="nofollow">main page</a>.</p> <p dir="auto">As well as migrating the github wiki, I can think of an addition that might make various peoples lives easier, a "common issues" page (think issue posted, instant close, link to part of common issues). There are also some random pages which could be removed i.e. <a href="https://github.com/mrdoob/three.js/wiki/API-Reference">API reference</a>. Those are two bits and pieces that come to mind but I'm sure others have more ideas.</p> <p dir="auto">It may help sort out miss-communication, speed up reviews and/or ease the barrier to entry.</p> <p dir="auto">I'd be happy to flesh out a first draft but I ain't starting that until I've got the proper feedback.</p>
<p dir="auto"><code class="notranslate">applyMatrix3</code> method of <code class="notranslate">BufferAttribute</code> presumes that <code class="notranslate">itemSize</code> equals 3. This can be seen in the <a href="https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js#L202">BufferAttribute source code on line 202</a>.<br> I'm a newbie of three.js and maybe I miss something, but I think that's not always true.<br> For example, UVs in <code class="notranslate">ShapeBufferGeometry</code> have only 2 dimensions.</p> <p dir="auto">This led to some <code class="notranslate">NaN</code> in the <code class="notranslate">BufferAttribute</code>'s array after applying <code class="notranslate">applyMatrix3</code>. Maybe it's possible to do a check <code class="notranslate">itemSize</code> inside the function to handle this case. For instance, we can use something similar to <code class="notranslate">Vector2</code>'s <code class="notranslate">applyMatrix3</code> if <code class="notranslate">itemSize === 2</code>.</p> <p dir="auto"><a href="https://codesandbox.io/s/agitated-cannon-lr7u9?file=/src/index.js" rel="nofollow">Here's a sandbox</a> that shows the problem and a simple function based on <code class="notranslate">Vector2</code>.</p> <p dir="auto">Three.js version: r117<br> Browser: All of them</p>
0
<p dir="auto">Hello,</p> <p dir="auto">The simple python program:</p> <p dir="auto">import matplotlib.pyplot as plt</p> <p dir="auto">numbers = [1,2,3,4,5]<br> plt.plot(numbers)<br> plt.show()</p> <p dir="auto">returns the following exception instead of drawing a picture. I'm using debian-testing and python 2.7.11-2 with:</p> <p dir="auto">dpkg -l python-matplotlib</p> <p dir="auto">ii python-matplotlib 1.5.3-1 i386 Python based plotting system in a style similar to Matlab</p> <p dir="auto">$ python test_overflowerror.py<br> Exception in Tkinter callback<br> Traceback (most recent call last):<br> File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1545, in <strong>call</strong><br> return self.func(*args)<br> File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 283, in resize<br> self.show()<br> File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 355, in draw<br> tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)<br> File "/usr/lib/python2.7/dist-packages/matplotlib/backends/tkagg.py", line 26, in blit<br> _tkagg.tkinit(tk.interpaddr(), 1)<br> OverflowError: Python int too large to convert to C long</p> <p dir="auto">Regards, Karol</p>
<p dir="auto">To help us understand and resolve your issue please check that you have provided<br> the information below.</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)</li> </ul> <p dir="auto">Platform: Debian Testing, using the python 2.7 (2.7.11-2 when I first started seeing this, just upgraded to 2.7.13rc1 but the problem still exists). I have this problem with the 1.5.3 on debian testing, but I also tried a virtualenv with pip install --pre matplotlib, which pulled in 2.0.0rc1, and I see the same problem.</p> <p dir="auto">Debian stable, with matplotlib 1.4.2, works fine, as did Debian testing until recently.</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> How did you install Matplotlib and Python (pip, anaconda, from source ...)</li> </ul> <p dir="auto">See above: Debian package and virtualenv.</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If possible please supply a <a href="http://sscce.org/" rel="nofollow">Short, Self Contained, Correct, Example</a><br> that demonstrates the issue i.e a small piece of code which reproduces the issue<br> and can be run with out any other (or as few as possible) external dependencies.</li> </ul> <p dir="auto">Minimal test program:</p> <p dir="auto">import pylab</p> <p dir="auto">distances = [0, 0.0011970407617050934, 0.0050796062254631295, 0.007303941153223762, 0.007303941153223762, 0.008232870398475445, 0.008232870398475445, 0.012806461740481582, 0.016651523629144134, 0.021047330616832543]<br> elevations = [6404.2, 6410.76, 6400.92, 6410.76, 6423.88, 6423.88, 6453.41, 6410.76, 6427.17, 6420.6]<br> pylab.plot(distances, elevations)<br> pylab.show()</p> <p dir="auto">(Please let me know if you want a non-pylab example. I see it with straight matplotlib too.)</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If this is an image generation bug attach a screenshot demonstrating the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> If this is a regression (Used to work in an earlier version of Matplotlib), please<br> note where it used to work.</li> </ul> <p dir="auto">It worked as recently as a month ago on Debian testing, but sorry, I don't know what matplotlib version that was since I didn't know it was going to stop working.</p>
1
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2> <p dir="auto">Exception ignored in: &lt;bound method _DataLoaderIter.<strong>del</strong> of &lt;torch.utils.data.dataloader._DataLoaderIter object at 0x114accb70&gt;&gt;<br> Traceback (most recent call last):<br> File "/Users/powerz/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 399, in <strong>del</strong><br> self._shutdown_workers()<br> File "/Users/powerz/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 378, in _shutdown_workers<br> self.worker_result_queue.get()<br> File "/Users/powerz/anaconda3/lib/python3.6/multiprocessing/queues.py", line 337, in get<br> return _ForkingPickler.loads(res)<br> File "/Users/powerz/anaconda3/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 167, in rebuild_storage_filename<br> storage = cls._new_shared_filename(manager, handle, size)<br> RuntimeError: Interrupted system call at /Users/soumith/miniconda2/conda-bld/pytorch_1532623076075/work/torch/lib/libshm/core.cpp:99</p> <h2 dir="auto">To Reproduce</h2> <p dir="auto">Randomly ,<br> Steps to reproduce the behavior:</p> <ol dir="auto"> <li></li> <li></li> <li></li> </ol> <h2 dir="auto">Expected behavior</h2> <h2 dir="auto">Environment</h2> <p dir="auto">Collecting environment information...<br> PyTorch version: 0.4.1<br> Is debug build: No<br> CUDA used to build PyTorch: None</p> <p dir="auto">OS: Mac OSX 10.14.2<br> GCC version: Could not collect<br> CMake version: version 3.13.0</p> <p dir="auto">Python version: 3.6<br> Is CUDA available: No<br> CUDA runtime version: No CUDA<br> GPU models and configuration: No CUDA<br> Nvidia driver version: No CUDA<br> cuDNN version: No CUDA</p> <p dir="auto">Versions of relevant libraries:<br> [pip] Could not collect<br> [conda] pytorch 0.4.1 py36_cuda0.0_cudnn0.0_1 pytorch<br> [conda] torchvision 0.2.1 py36_1 pytorch</p> <h2 dir="auto">Additional context</h2>
<p dir="auto">This causes errors in data loaders like <a href="https://discuss.pytorch.org/t/dataloader-always-failed-with-interrupted-system-call/30242" rel="nofollow">this</a>.</p>
1
<p dir="auto">This is the result of using subdiv level 1 on a textured mesh in jthree</p> <p dir="auto"><a href="http://3developer.com/tmp/UVs.png" rel="nofollow">http://3developer.com/tmp/UVs.png</a></p> <p dir="auto">As you can see the seams are terrible. Also tried using image mode repeat as a sugestion by "bai" from IRC but that didn't make a change</p> <p dir="auto">This is the same model in blender, subdiv level 1, UV subdivision turned off</p> <p dir="auto"><a href="http://3developer.com/tmp/UVsBlenderSubOff.png" rel="nofollow">http://3developer.com/tmp/UVsBlenderSubOff.png</a></p> <p dir="auto">Much better! Now again but with UV subdivision turned on</p> <p dir="auto"><a href="http://3developer.com/tmp/UVsBlenderSubOn.png" rel="nofollow">http://3developer.com/tmp/UVsBlenderSubOn.png</a></p> <p dir="auto">Not a giant improvement but this feature can be very useful sometimes</p>
<h5 dir="auto">Description of the problem</h5> <p dir="auto">Uncaught Rangerror: Offset is outside the bounds of the dataview</p> <p dir="auto">VTKLoader failing on loading legacy format VTU file in binary, unstructured data grid.</p> <p dir="auto">I have the model and some screenshots of the error here:<br> <a href="https://www.dropbox.com/sh/ti1s42u4nx8nj9r/AAC4gcUsvYVunh968xZB3YNda?dl=0" rel="nofollow">https://www.dropbox.com/sh/ti1s42u4nx8nj9r/AAC4gcUsvYVunh968xZB3YNda?dl=0</a></p> <p dir="auto">I am able to load said model in paraview (which is VTK's own desktop client viewer) so I don't think it's a problem with the model itself? I am not sure.</p> <p dir="auto">line 492 in vtkloader.js:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" } else if ( line.indexOf ( 'POINT_DATA' ) === 0 ) { numberOfPoints = parseInt ( line.split( ' ' )[ 1 ], 10 ); // Grab the next line state = findString ( buffer, state.next ); // Now grab the binary data count = numberOfPoints * 4 * 3; normals = new Float32Array( numberOfPoints * 3 ); pointIndex = state.next; for ( i = 0; i &lt; numberOfPoints; i ++ ) { error here--&gt; normals[ 3 * i ] = dataView.getFloat32( pointIndex, false ); normals[ 3 * i + 1 ] = dataView.getFloat32( pointIndex + 4, false ); normals[ 3 * i + 2 ] = dataView.getFloat32( pointIndex + 8, false ); pointIndex += 12;"><pre class="notranslate"><code class="notranslate"> } else if ( line.indexOf ( 'POINT_DATA' ) === 0 ) { numberOfPoints = parseInt ( line.split( ' ' )[ 1 ], 10 ); // Grab the next line state = findString ( buffer, state.next ); // Now grab the binary data count = numberOfPoints * 4 * 3; normals = new Float32Array( numberOfPoints * 3 ); pointIndex = state.next; for ( i = 0; i &lt; numberOfPoints; i ++ ) { error here--&gt; normals[ 3 * i ] = dataView.getFloat32( pointIndex, false ); normals[ 3 * i + 1 ] = dataView.getFloat32( pointIndex + 4, false ); normals[ 3 * i + 2 ] = dataView.getFloat32( pointIndex + 8, false ); pointIndex += 12; </code></pre></div> <p dir="auto">I noticed there is a similar issue here: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135959538" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/8208" data-hovercard-type="pull_request" data-hovercard-url="/mrdoob/three.js/pull/8208/hovercard" href="https://github.com/mrdoob/three.js/pull/8208">#8208</a> not sure if related.</p> <h5 dir="auto">Three.js version</h5> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Dev</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r80</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li> </ul> <h5 dir="auto">Browser</h5> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li> </ul> <h5 dir="auto">OS</h5> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> IOS</li> </ul> <h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>
0
<p dir="auto">by <strong>beoran</strong>:</p> <pre class="notranslate">What steps will reproduce the problem? 1. Unpack the attached testcase and cd to that directory. 2. $ ./makelib.bash 3. $ make install 4. $ gotest What is the expected output? SUCCESS What do you see instead? FAIL What is your $GOOS? $GOARCH? linux 386 Which revision are you using? (hg identify) 8d9692dbc21b+ tip Please provide any additional information below. As the title said cgo doesn't seem to handle (taking addresses of) global struct values corectly. It generates a pointer to the type but that pointer is never filleed in, and always ends up nil. I thinks this should be corected somehow.</pre> <p dir="auto">Attachments:</p> <ol dir="auto"> <li><a href="https://storage.googleapis.com/go-attachment/828/0/ges.tar.gz" rel="nofollow">ges.tar.gz</a> (860 bytes)</li> </ol>
<p dir="auto">In Go 1.3.x, it was possible to statically link a program which imports the net package. This is important when building programs for cut-down environments, for example busybox.</p> <p dir="auto">The problem can be reproduced on Ubuntu as <a href="https://groups.google.com/forum/#!msg/golang-nuts/S2WDcm47bhA/W243-l49WDsJ" rel="nofollow">reported</a> by Vasiliy Tolstov:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="package main import &quot;net&quot; func main() { _, _ = net.ResolveIPAddr(&quot;ip&quot;, &quot;google.com&quot;) } "><pre class="notranslate"><code class="notranslate">package main import "net" func main() { _, _ = net.ResolveIPAddr("ip", "google.com") } </code></pre></div> <p dir="auto">It is possible to statically link this program in Go 1.3.x by issuing:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CGO_ENABLED=0 go build -a -x"><pre class="notranslate"><code class="notranslate">CGO_ENABLED=0 go build -a -x </code></pre></div> <p dir="auto">but with Go 1.4, the same technique creates the following runtime dependencies:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="linux-vdso.so.1 (0x00007fff603fe000) libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x00007f3bd0608000) libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f3bd0260000) /lib64/ld-linux-x86-64.so.2 (0x00007f3bd0825000) "><pre class="notranslate"><code class="notranslate">linux-vdso.so.1 (0x00007fff603fe000) libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x00007f3bd0608000) libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f3bd0260000) /lib64/ld-linux-x86-64.so.2 (0x00007f3bd0825000) </code></pre></div>
0
<p dir="auto">Steps to reproduce:<br> i) Do this gist: <a href="https://gist.github.com/jviotti/aadc0ba1d5962cfe19cf">https://gist.github.com/jviotti/aadc0ba1d5962cfe19cf</a> but add <code class="notranslate">frame: false</code> to BrowserWindow<br> ii) Notice you can drag the Window by clicking and ragging on Hello World<br> iii) Go to View Toggle dev tools so the dev tools are opened.<br> iv) Try to drag again.</p> <p dir="auto">Actual results:<br> The window drag in step iv) won't work anymore.</p> <p dir="auto">Expected results:<br> The dragging continues to work.</p>
<p dir="auto">This is a regression—in Electron <code class="notranslate">0.35.1</code>, draggable regions of the window stop working when the developer tools are opened. This means that the window effectively can't be moved while the developer tools are open. It doesn't matter if the developer tools are docked or in a separate window.</p> <p dir="auto">I think this might be a side effect of an intentional change? In previous versions, you couldn't use the "Inspect Element" feature to click and select part of the DOM that was in a draggable region (since it was still draggable.) That now works (I can hover over and click on my title bar), but I can't move the window.</p> <p dir="auto">Here's a sample app to reproduce. Open the app, enable "top toolbar" and then open the developer tools:</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1037212/11510691/d2c9aa5c-9819-11e5-911e-55a87b840dc2.png"><img src="https://cloud.githubusercontent.com/assets/1037212/11510691/d2c9aa5c-9819-11e5-911e-55a87b840dc2.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto"><a href="https://dl.dropboxusercontent.com/u/4803975/frameless-window.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/4803975/frameless-window.zip</a></p>
1
<p dir="auto">When i run my bootsrap run locally disappears by the gylphicon docs the bottom border. Is this normal?</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6adbcc1d43a4b3f982970856e316585140621f7b3e8ca158d5fb59058d78bf11/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f353630323931382f313735393035362f30373039666131612d363639392d313165332d383237362d3566653863363161343432372e706e67"><img src="https://camo.githubusercontent.com/6adbcc1d43a4b3f982970856e316585140621f7b3e8ca158d5fb59058d78bf11/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f353630323931382f313735393035362f30373039666131612d363639392d313165332d383237362d3566653863363161343432372e706e67" alt="screenshot from 2013-12-16 22 28 08" data-canonical-src="https://f.cloud.github.com/assets/5602918/1759056/0709fa1a-6699-11e3-8276-5fe8c61a4427.png" style="max-width: 100%;"></a><br> Hi i'm on a linux 13.04 a,d when i run bootstrap locally the border on the bs-glyphicons won't show. Is this normal?</p>
1
<p dir="auto"><strong>Update</strong>: This issue explained in my comment seems to have been fixed in v7.11.0 (see <a href="https://github.com/npm/cli/issues/2971#issuecomment-1035156508" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/2971/hovercard">my update comment</a>), however, another user has <a href="https://github.com/npm/cli/issues/2971#issuecomment-891422616" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/2971/hovercard">described a similar error</a> in v7.20.3, so I'm unsure whether I should close this issue or leave it open.</p> <p dir="auto"><strong>Using a git URL in the format <code class="notranslate">github:geotiffjs/geotiff.js#commit-hash</code> on NPM v7 fails with sha-512 integrity errors. However, using a branch-name/tag pointing to the same commit works fine.</strong></p> <p dir="auto">I can't seem to find another Git repo where this is failing (except for forks of geotiff.js), so I think the issue might either with Github repos with periods in their name and/or with <code class="notranslate">package.json</code> <code class="notranslate">prepare</code> scripts.</p> <p dir="auto">This might be related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="838432980" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/2919" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/2919/hovercard" href="https://github.com/npm/cli/issues/2919">#2919</a> which has a similar title, but their logs and behaviour are different.<br> I'm fairly certain this is an issue with the CDN, since it doesn't happen in Node v6, and if I use a <code class="notranslate">get+ssh</code> URL on a new VM, the code fails before I get a pop-up with a <code class="notranslate">The authenticity of host 'github.com (140.82.121.3)' can't be established.</code></p> <h3 dir="auto">Current Behavior:</h3> <p dir="auto">For the <a href="https://github.com/geotiff/geotiff.js">geotiff/geotiff.js</a> repo, using a <code class="notranslate">git+https://...#commit-hash</code> URL fails with a <code class="notranslate">EINTEGRITY</code> error, due to the sha512 error, e.g.</p> <div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ubuntu@gittest:~/geotiff.js$ npm pack &quot;git+https://github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2&quot; npm WARN tarball tarball data for git+ssh://[email protected]/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2 (sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw==) seems to be corrupted. Trying again. npm WARN tarball tarball data for git+ssh://[email protected]/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2 (sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw==) seems to be corrupted. Trying again. npm ERR! code EINTEGRITY npm ERR! sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw== integrity checksum failed when using sha512: wanted sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw== but got sha512-c2I+9X+wgzfOMS8/Fn09R8BjPrjEavxj0r39aO/loMvtWlA6BNxAlatfcnW8WHhOfgbEbIRi9k3WNpJh2yoxKQ==. (709406 bytes) npm ERR! A complete log of this run can be found in: npm ERR! /home/ubuntu/.npm/_logs/2021-03-26T14_59_04_649Z-debug.log"><pre class="notranslate"><span class="pl-e">ubuntu@gittest:~/geotiff.js</span>$ <span class="pl-s1">npm pack <span class="pl-s"><span class="pl-pds">"</span>git+https://github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2<span class="pl-pds">"</span></span></span> <span class="pl-c1">npm WARN tarball tarball data for git+ssh://[email protected]/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2 (sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw==) seems to be corrupted. Trying again.</span> <span class="pl-c1">npm WARN tarball tarball data for git+ssh://[email protected]/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2 (sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw==) seems to be corrupted. Trying again.</span> <span class="pl-c1">npm ERR! code EINTEGRITY</span> <span class="pl-c1">npm ERR! sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw== integrity checksum failed when using sha512: wanted sha512-NdxkcAm6FPXBKyhAHuYp0yMyKcBboXzf00h9hqo+yAVhAPVk6d68GH11SV9n4v2OZ9Roe1zQfCzV4TuoeskVLw== but got sha512-c2I+9X+wgzfOMS8/Fn09R8BjPrjEavxj0r39aO/loMvtWlA6BNxAlatfcnW8WHhOfgbEbIRi9k3WNpJh2yoxKQ==. (709406 bytes)</span> <span class="pl-c1">npm ERR! A complete log of this run can be found in:</span> <span class="pl-c1">npm ERR! /home/ubuntu/.npm/_logs/2021-03-26T14_59_04_649Z-debug.log</span></pre></div> <p dir="auto">Attached logfile: <a href="https://github.com/npm/cli/files/6212631/2021-03-26T14_59_04_649Z-debug.log">2021-03-26T14_59_04_649Z-debug.log</a></p> <p dir="auto">The same error occurs if you try to do <code class="notranslate">npm install</code> on the URL, or if you use a <code class="notranslate">git+ssh</code> url, or a short <code class="notranslate">github:</code> url: <code class="notranslate">github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2</code></p> <h3 dir="auto">Expected Behavior:</h3> <p dir="auto">Using NPM v6.14.11, the exact same command works fine.</p> <div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# ON NPM v6 ubuntu@gittest:~/geotiff.js$ npm pack &quot;git+https://github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2&quot; npm notice npm notice 📦 [email protected] npm notice === Tarball Contents === npm notice 1.1kB LICENSE # ...etc"><pre class="notranslate"># <span class="pl-s1">ON NPM v6</span> <span class="pl-e">ubuntu@gittest:~/geotiff.js</span>$ <span class="pl-s1">npm pack <span class="pl-s"><span class="pl-pds">"</span>git+https://github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2<span class="pl-pds">"</span></span></span> <span class="pl-c1">npm notice </span> <span class="pl-c1">npm notice 📦 [email protected]</span> <span class="pl-c1">npm notice === Tarball Contents === </span> <span class="pl-c1">npm notice 1.1kB LICENSE</span> # <span class="pl-s1">...etc</span></pre></div> <p dir="auto">Additionally, even on NPM v7.7.5, using a branch/tag name works fine: e.g.<code class="notranslate">npm pack "github:github.com/geotiffjs/geotiff.js.git#v1.0.0"</code> works on NPMv7, even though tag <code class="notranslate">v1.0.0</code> points to the same commit.</p> <h3 dir="auto">Steps To Reproduce:</h3> <p dir="auto">On NPM v7.7.5, run the following command:</p> <p dir="auto"><code class="notranslate">npm pack "git+https://github.com/geotiffjs/geotiff.js.git#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2"</code></p> <p dir="auto">You can also try spinning up an Ubuntu VM using <code class="notranslate">minipool</code>:</p> <ul dir="auto"> <li><code class="notranslate">multipass launch --name npm-git-test &amp;&amp; multipass shell npm-git-test</code></li> <li>install NVM then restart shell <code class="notranslate">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash</code></li> <li>Try working cmd on NPM v6.14.11: <code class="notranslate">npm pack github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2</code></li> <li>Update to NPM v7.7.5 and see the same command fail: <code class="notranslate">npm install -g npm &amp;&amp; npm pack github:geotiffjs/geotiff.js#c01b2dcf00d5a324cd27c38709cb6ca97adf01e2</code></li> </ul> <h3 dir="auto">Environment:</h3> <p dir="auto">I've tested this on a VM running:</p> <ul dir="auto"> <li>OS: Ubuntu 20.04.2 LTS</li> <li>Node: v14.16.0</li> <li>npm: 7.7.5</li> </ul> <p dir="auto">and a desktop running:</p> <ul dir="auto"> <li>OS: Ubuntu 20.04.2 LTS</li> <li>Node: v12.19.1</li> <li>npm: 7.7.5</li> </ul>
<h3 dir="auto">Current Behavior:</h3> <p dir="auto">The <code class="notranslate">package-lock.json</code> integrity value seems to depend on the OS/architecture. Take the following git dependency which specifies a commit hash:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="npm pack &quot;git+ssh://[email protected]/jhiesey/idb-kv-store.git#109ccad165fd6470e12fd66025da9e4743a46043&quot;"><pre class="notranslate"><span class="pl-s1">npm</span> <span class="pl-s1">pack</span> <span class="pl-s">"git+ssh://[email protected]/jhiesey/idb-kv-store.git#109ccad165fd6470e12fd66025da9e4743a46043"</span></pre></div> <p dir="auto">The integrity value produced is different on these OSes/architectures:</p> <ul dir="auto"> <li>Ubuntu 20.04, and macOS 11.2.3 (Intel): <code class="notranslate">sha512-DnBTbDDxd9/9mwPehyraeuRTbNEqbWLcAdE3GC1trdBWWwKnkWsaU/X6mVLIKKB/IYWmG+cnL3ihg/Ql/rW5kg==</code></li> <li>macOS 11.2.3 (Apple Silicon): <code class="notranslate">sha512-T3ZWOM1TT+Ch/splApkEe1HwktWs+n/iHvDvtIGEI+4xuMGHite6mMujuNd8sen49ofLP/PxzprQMSPJK8APww==</code></li> </ul> <h3 dir="auto">Expected Behavior:</h3> <p dir="auto">The integrity value should not be different on Apple Silicon (M1 chip) machines.</p> <h3 dir="auto">Steps To Reproduce:</h3> <p dir="auto">Run <code class="notranslate">npm pack "git+ssh://[email protected]/jhiesey/idb-kv-store.git#109ccad165fd6470e12fd66025da9e4743a46043" </code> and inspect the integrity value from an M1 Mac. Node.js was installed from Homebrew using <code class="notranslate">brew install node</code> and the <code class="notranslate">amd64</code> version was installed.</p> <p dir="auto">Also... <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jhiesey/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jhiesey">@jhiesey</a> and I dug into this a bit and found that the tarballs fetched from the GitHub CDN are exactly the same on M1 and other architectures, byte-for-byte. Same for the ungzipped tarballs – they are the same byte-for-byte. What differs, though, is the gzipped tarballs (<code class="notranslate">.tar.gz</code>) files. Those appear to have substantial differences when viewed in a hex editor.</p> <h3 dir="auto">Environment:</h3> <ul dir="auto"> <li>OS: Various, see above</li> <li>Node: v15.11.0</li> <li>npm: 7.6.2</li> </ul>
1
<p dir="auto">Expected behavior:<br> In this video, you can see that Tree map..., Map... , 2 heat maps and Sunburst... are not showing in the tree structure, while some charts have duplicate.</p> <p dir="auto">It's not a consistent issue, other dashboards seems ok...<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/villebro/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/villebro">@villebro</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/simcha90/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/simcha90">@simcha90</a> please investigate <g-emoji class="g-emoji" alias="pray" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f64f.png">🙏</g-emoji></p> <details open="" class="details-reset border rounded-2"> <summary class="px-3 py-2"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-camera-video"> <path d="M16 3.75v8.5a.75.75 0 0 1-1.136.643L11 10.575v.675A1.75 1.75 0 0 1 9.25 13h-7.5A1.75 1.75 0 0 1 0 11.25v-6.5C0 3.784.784 3 1.75 3h7.5c.966 0 1.75.784 1.75 1.75v.675l3.864-2.318A.75.75 0 0 1 16 3.75Zm-6.5 1a.25.25 0 0 0-.25-.25h-7.5a.25.25 0 0 0-.25.25v6.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-6.5ZM11 8.825l3.5 2.1v-5.85l-3.5 2.1Z"></path> </svg> <span aria-label="Video description Screen.Recording.2021-05-26.at.10.38.54.PM.mov" class="m-1">Screen.Recording.2021-05-26.at.10.38.54.PM.mov</span> <span class="dropdown-caret"></span> </summary> <video src="https://user-images.githubusercontent.com/67837651/119771993-5dd9bf80-be73-11eb-9483-4286ff9ecacb.mov" data-canonical-src="https://user-images.githubusercontent.com/67837651/119771993-5dd9bf80-be73-11eb-9483-4286ff9ecacb.mov" controls="controls" muted="muted" class="d-block rounded-bottom-2 border-top width-fit" style="max-height:640px; min-height: 200px"> </video> </details> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/villebro/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/villebro">@villebro</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/simcha90/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/simcha90">@simcha90</a> please coordinate a fix. <g-emoji class="g-emoji" alias="pray" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f64f.png">🙏</g-emoji></p>
<h4 dir="auto">How to reproduce the bug</h4> <ol dir="auto"> <li>Open explore view from chart list,</li> <li>or Explore chart from dashboard,</li> </ol> <h3 dir="auto">Actual results</h3> <p dir="auto">You will see 2 /api/v1/chart/<em>id</em> requests</p> <h3 dir="auto">Expected results</h3> <p dir="auto">only 1 api call for each endpoint.</p> <h4 dir="auto">Screenshots</h4> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/27990562/100675338-9f9e0900-331b-11eb-8f4d-163c6a5bcfb7.png"><img width="1172" alt="Screen Shot 2020-11-30 at 2 47 56 PM" src="https://user-images.githubusercontent.com/27990562/100675338-9f9e0900-331b-11eb-8f4d-163c6a5bcfb7.png" style="max-width: 100%;"></a></p> <h3 dir="auto">Environment</h3> <p dir="auto">latest master</p> <h3 dir="auto">Checklist</h3> <p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li> </ul> <h3 dir="auto">Additional context</h3> <p dir="auto">Add any other context about the problem here.</p>
0
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: 2.7.3</li> <li>Operating System version: Linux iZwz9b62gfds6u2rpy623tZ 3.10.0-514.26.2.el7.x86_64 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="5423124" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/1" data-hovercard-type="pull_request" data-hovercard-url="/apache/dubbo/pull/1/hovercard" href="https://github.com/apache/dubbo/pull/1">#1</a> SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux</li> <li>Java version: 1.8</li> </ul> <h3 dir="auto">Steps to reproduce this issue</h3> <p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p> <h3 dir="auto">Expected Result</h3> <p dir="auto">What do you expected from the above steps?</p> <h3 dir="auto">Actual Result</h3> <p dir="auto">在同一个机器上部署了zk, 服务提供者, 服务消费者(web),<br> 在tomcat正常启动一段时间后,抛异常,zk连接不上了,<br> 但是服务提供者与zk的心跳是正常的。</p> <p dir="auto">If there is an exception, please attach the exception trace:<br> [WEB_MOBILE] [localhost-startStop-1-SendThread(iZwz9b62gfds6u2rpy623tZ:2181)] 2019-10-17 17:19:13 [ INFO] (org.apache.zookeeper.ClientCnxn$SendThread:1029) | Opening socket connection to server iZwz9b62gfds6u2rpy623tZ/10.81.249.56:2181. Will not attempt to authenticate using SASL (unknown error)<br> [WEB_MOBILE] [localhost-startStop-1-SendThread(iZwz9b62gfds6u2rpy623tZ:2181)] 2019-10-17 17:19:13 [ INFO] (org.apache.zookeeper.ClientCnxn$SendThread:879) | Socket connection established to iZwz9b62gfds6u2rpy623tZ/10.81.249.56:2181, initiating session<br> [WEB_MOBILE] [localhost-startStop-1-SendThread(iZwz9b62gfds6u2rpy623tZ:2181)] 2019-10-17 17:19:13 [ WARN] (org.apache.zookeeper.ClientCnxn$SendThread:1168) | Session 0x10637dcf99d0049 for server iZwz9b62gfds6u2rpy623tZ/10.81.249.56:2181, unexpected error, closing socket connection and attempting reconnect<br> java.lang.NoClassDefFoundError: org/apache/zookeeper/proto/SetWatches<br> at org.apache.zookeeper.ClientCnxn$SendThread.primeConnection(ClientCnxn.java:929)<br> at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:363)<br> at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1145)<br> [WEB_MOBILE] [NettyClientWorker-1-2] 2019-10-17 17:19:14 [ WARN] (io.netty.util.internal.logging.Slf4JLogger:151) | Unexpected exception in the selector loop.<br> java.lang.NoClassDefFoundError: io/netty/channel/AdaptiveRecvByteBufAllocator$HandleImpl<br> at io.netty.channel.AdaptiveRecvByteBufAllocator.newHandle(AdaptiveRecvByteBufAllocator.java:196)<br> at io.netty.channel.AbstractChannel$AbstractUnsafe.recvBufAllocHandle(AbstractChannel.java:438)<br> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:140)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)<br> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)<br> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)<br> at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)<br> at java.lang.Thread.run(Thread.java:748)<br> [WEB_MOBILE] [NettyClientWorker-1-4] 2019-10-17 17:19:14 [ WARN] (io.netty.util.internal.logging.Slf4JLogger:151) | Unexpected exception in the selector loop.<br> java.lang.NoClassDefFoundError: io/netty/channel/AdaptiveRecvByteBufAllocator$HandleImpl<br> at io.netty.channel.AdaptiveRecvByteBufAllocator.newHandle(AdaptiveRecvByteBufAllocator.java:196)<br> at io.netty.channel.AbstractChannel$AbstractUnsafe.recvBufAllocHandle(AbstractChannel.java:438)<br> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:140)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)<br> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)<br> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)<br> at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)<br> at java.lang.Thread.run(Thread.java:748)<br> [WEB_MOBILE] [NettyClientWorker-1-5] 2019-10-17 17:19:14 [ WARN] (io.netty.util.internal.logging.Slf4JLogger:151) | Unexpected exception in the selector loop.<br> java.lang.NoClassDefFoundError: io/netty/channel/AdaptiveRecvByteBufAllocator$HandleImpl<br> at io.netty.channel.AdaptiveRecvByteBufAllocator.newHandle(AdaptiveRecvByteBufAllocator.java:196)<br> at io.netty.channel.AbstractChannel$AbstractUnsafe.recvBufAllocHandle(AbstractChannel.java:438)<br> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:140)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)<br> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)<br> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)<br> at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)<br> at java.lang.Thread.run(Thread.java:748)<br> [WEB_MOBILE] [NettyClientWorker-1-1] 2019-10-17 17:19:14 [ WARN] (io.netty.util.internal.logging.Slf4JLogger:151) | Unexpected exception in the selector loop.<br> java.lang.NoClassDefFoundError: io/netty/channel/AdaptiveRecvByteBufAllocator$HandleImpl<br> at io.netty.channel.AdaptiveRecvByteBufAllocator.newHandle(AdaptiveRecvByteBufAllocator.java:196)<br> at io.netty.channel.AbstractChannel$AbstractUnsafe.recvBufAllocHandle(AbstractChannel.java:438)<br> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:140)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)<br> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)<br> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)<br> at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)<br> at java.lang.Thread.run(Thread.java:748)<br> [WEB_MOBILE] [NettyClientWorker-1-3] 2019-10-17 17:19:14 [ WARN] (io.netty.util.internal.logging.Slf4JLogger:151) | Unexpected exception in the selector loop.<br> java.lang.NoClassDefFoundError: io/netty/channel/AdaptiveRecvByteBufAllocator$HandleImpl<br> at io.netty.channel.AdaptiveRecvByteBufAllocator.newHandle(AdaptiveRecvByteBufAllocator.java:196)<br> at io.netty.channel.AbstractChannel$AbstractUnsafe.recvBufAllocHandle(AbstractChannel.java:438)<br> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:140)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582)<br> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)<br> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)<br> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)<br> at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)<br> at java.lang.Thread.run(Thread.java:748)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here! </code></pre></div>
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li> </ul> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>Dubbo version: 2.7.3</li> <li>Operating System version: windows10</li> <li>Java version: 1.8</li> </ul> <h3 dir="auto">Steps to reproduce this issue</h3> <ol dir="auto"> <li>我想禁用org.apache.dubbo.rpc.filter.ExceptionFilter,使用自已定义的异常过滤器,以便使自定义的异常可以在customer方捕捉到,我现在的做法是修改了dubbo源码包META-INF\dubbo\internal\org.apache.dubbo.rpc.Filter下面的exception=com.seals.web.conf.DubboExceptionFilter,直接换成了自己的filter,但这样似乎不太友好,请问有其它的解决方案么</li> </ol>
0
<p dir="auto">Challenge <a href="https://www.freecodecamp.com/en/challenges/basic-javascript/escaping-literal-quotes-in-strings" rel="nofollow">escaping-literal-quotes-in-strings</a> has an issue.<br> User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36</code>.<br> Please describe how to reproduce this issue, and include links to screenshots if possible.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" var myStr = &quot;I am a \&quot;double quoted\&quot; string inside \&quot;double quotes\&quot;.&quot;; // Change this line ![escaping literal quotes](https://cloud.githubusercontent.com/assets/21290175/18400642/cbfdd8dc-76a4-11e6-9b20-cd3b661daf4a.jpg) It passes the _Variable myStr should contain the string: I am a &quot;double quoted&quot; string inside &quot;double quotes&quot;.__ But fails the _You should use two double quotes (&quot;) and four escaped double quotes (\&quot;)._"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">myStr</span> <span class="pl-c1">=</span> <span class="pl-s">"I am a \"double quoted\" string inside \"double quotes\"."</span><span class="pl-kos">;</span> <span class="pl-c">// Change this line</span> <span class="pl-c1">!</span><span class="pl-kos">[</span><span class="pl-s1">escaping</span> <span class="pl-s1">literal</span> <span class="pl-s1">quotes</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">https</span>:<span class="pl-c">//cloud.githubusercontent.com/assets/21290175/18400642/cbfdd8dc-76a4-11e6-9b20-cd3b661daf4a.jpg)</span> <span class="pl-v">It</span> <span class="pl-s1">passes</span> <span class="pl-s1">the</span> <span class="pl-s1">_Variable</span> <span class="pl-s1">myStr</span> <span class="pl-s1">should</span> <span class="pl-s1">contain</span> <span class="pl-s1">the</span> <span class="pl-s1">string</span>: <span class="pl-v">I</span> <span class="pl-s1">am</span> <span class="pl-s1">a</span> <span class="pl-s">"double quoted"</span> <span class="pl-s1">string</span> <span class="pl-s1">inside</span> <span class="pl-s">"double quotes"</span><span class="pl-kos">.</span><span class="pl-c1">__</span> <span class="pl-v">But</span> <span class="pl-s1">fails</span> <span class="pl-s1">the</span> <span class="pl-s1">_You</span> <span class="pl-s1">should</span> <span class="pl-s1">use</span> <span class="pl-s1">two</span> <span class="pl-s1">double</span> <span class="pl-s1">quotes</span> <span class="pl-kos">(</span>") and four escaped double quotes (\")._</pre></div>
<p dir="auto">On the current staging, two challenges ("Escaping Literal Quotes in Strings" and "Quoting Strings with Single Quotes") do not pass all tests with standard solution code.</p> <p dir="auto">Namely, tests asserting regex match lengths for non-escaped double quotes are failing:<br> <code class="notranslate">code.match(/[^\\\\]\"/g).length === 2</code> in the former challenge and<br> <code class="notranslate">code.match(/\"/g).length === 4</code> in the latter.</p> <p dir="auto">(Note: each of these is only one half of their respective test, and it might be beneficial in this case to split each test into two parts so users know where to look for their mistake instead of counting every quotation mark, as well as speeding up debugging if something breaks the regex again later on.)</p>
1
<h2 dir="auto"><g-emoji class="g-emoji" alias="memo" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji> New keyboard shortcut to minimize windows</h2> <p dir="auto">Create a shortcut (ex: Win + Shift + m ) to minimize all windows in the screen where the mouse is.</p> <hr> <p dir="auto">If you'd like to see this feature implemented, add a <g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji> reaction to this post.</p>
<p dir="auto">Ability to set any window "always on top".</p> <p dir="auto">It will be better to have this feature as this is required in most of the scenarios when we refer and type or do something.</p> <p dir="auto">Best place for this feature inclusion will be in the window title right click menu, with minimize, maximize, restore etc</p>
0
<h3 dir="auto">Preflight Checklist</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for a feature request that matches the one I want to file, without success.</li> </ul> <h3 dir="auto">Problem Description</h3> <p dir="auto">Electron apps are increasing exponentially. Nowadays we have to use multiple electron app instances in the same computer.<br> But every single app instance runs a separate instance of Chromium/ElectronJS which uses more resources, which is bad for performance.</p> <h3 dir="auto">Proposed Solution</h3> <p dir="auto">Since, multiple apps are already using Chromium/ElectronJS, if there was a way to make them share the same instance of Chromium/ElectronJS, kind of like multiple Tabs/Windows in a browser, that would make ElectronJS apps faster, less resource hungry, and so on.</p> <h3 dir="auto">Alternatives Considered</h3> <p dir="auto">I have searched for some alternatives but haven't found any yet</p> <h3 dir="auto">Additional Information</h3> <p dir="auto">Or if there's an App made by the official team of ElectronJS that scans all the ElectronJS apps installed in the system and puts them into the same ElectronJS folder/instance to share resources, should be good too.</p> <p dir="auto">Thanks</p>
<ul dir="auto"> <li>Electron version: 1.4.13</li> <li>Operating system: Windows 7 - fails, Windows 8.1 - fails, Windows 10 - works only at the first try, subsequent tries fail, OS X 10.11 - works, Ubuntu 16.04 - works</li> </ul> <h3 dir="auto">Expected behavior</h3> <p dir="auto">When printing selected pages of a web page with electron the selected pages will be printed.</p> <h3 dir="auto">Actual behavior</h3> <p dir="auto">The print job hangs in the print job queue until the electron app is closed.</p> <h3 dir="auto">How to reproduce</h3> <p dir="auto">Open a web page in electron which spreads over several pages when printed. Use <code class="notranslate">window.print()</code> or <code class="notranslate">webContents.print([options])</code> to print the page. Select some pages (e.g. <code class="notranslate">2,4,6-8</code> ) in the <code class="notranslate">Page Range</code> field inside the system print dialog. Press <code class="notranslate">Print</code>.</p>
0
<p dir="auto"><code class="notranslate">hyperkube</code> offers significant advantages in terms of reducing our distribution size and simplifying the number of things that need to be juggled. But some deployment scenarios are using separate binaries while others are using <code class="notranslate">hyperkube</code>. We should switch everything over to <code class="notranslate">hyperkube</code> and deprecate/remove the individual binaries.</p> <p dir="auto">Issues that need to be addressed before we can get there: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="113752864" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/16410" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/16410/hovercard" href="https://github.com/kubernetes/kubernetes/issues/16410">#16410</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="80441433" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/8772" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/8772/hovercard" href="https://github.com/kubernetes/kubernetes/issues/8772">#8772</a>.</p> <p dir="auto">If we can agree on this being a good direction, I'm happy to chip in and do the work.</p>
<p dir="auto">Garbage collector changes the objects in local cache: <a href="https://github.com/kubernetes/kubernetes/blob/v1.6.0-beta.4/pkg/controller/garbagecollector/graph_builder.go#L115">https://github.com/kubernetes/kubernetes/blob/v1.6.0-beta.4/pkg/controller/garbagecollector/graph_builder.go#L115</a></p> <p dir="auto">This is discouraged. It's probably ok for now, because the garbage collector doesn't share the cache with other controllers. We need to revisit this when the garbage collector starts to use the shared cache.</p> <p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lavalamp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lavalamp">@lavalamp</a></p> <p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):</p> <p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p> <hr> <p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):</p> <p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p> <p dir="auto"><strong>Environment</strong>:</p> <ul dir="auto"> <li><strong>Cloud provider or hardware configuration</strong>:</li> <li><strong>OS</strong> (e.g. from /etc/os-release):</li> <li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):</li> <li><strong>Install tools</strong>:</li> <li><strong>Others</strong>:</li> </ul> <p dir="auto"><strong>What happened</strong>:</p> <p dir="auto"><strong>What you expected to happen</strong>:</p> <p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p> <p dir="auto"><strong>Anything else do we need to know</strong>:</p>
0
<p dir="auto">I observed a developer unable to figure out how to use ListView due to lack of content in the API doc. While the ListView constructor is relatively easy to understand, ListView.builder() and ListView.custom are less so. It would be great to include some sample code in the API doc.</p>
<p dir="auto">I think we need some high level documentation of all the list and viewport classes, including a class hierarchy diagram showing inheritance, mixins, ownership, and who creates whom. It should probably lean on some other documentation explaining the purpose of custom Element subclasses, too.</p>
1
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">Next should refresh dynamic imported components using HMR.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">This bug depends on the place where the dynamic component is created. It works when the dynamic component is created on a page, but it doesn't work when it's created outside and imported using a regular <code class="notranslate">import x from</code>.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <p dir="auto">Create a component:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export default () =&gt; &lt;p&gt; I am the component&lt;/p&gt;;"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">p</span><span class="pl-c1">&gt;</span> I am the component<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">p</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span></pre></div> <p dir="auto">If you import that component and create the dynamic component on that page, HMR works:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import dynamic from 'next/dynamic'; const DynamicComponent = dynamic(import('../components/Component.js')); export default () =&gt; ( &lt;div&gt; &lt;DynamicComponent /&gt; &lt;/div&gt; );"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">dynamic</span> <span class="pl-k">from</span> <span class="pl-s">'next/dynamic'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-v">DynamicComponent</span> <span class="pl-c1">=</span> <span class="pl-en">dynamic</span><span class="pl-kos">(</span><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'../components/Component.js'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span> <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-v">DynamicComponent</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">But if the dynamic import is on a different file, for example <code class="notranslate">DynamicComponent.js</code>:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import dynamic from 'next/dynamic'; const DynamicComponent = dynamic(import('./Component')); export default DynamicComponent;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">dynamic</span> <span class="pl-k">from</span> <span class="pl-s">'next/dynamic'</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-v">DynamicComponent</span> <span class="pl-c1">=</span> <span class="pl-en">dynamic</span><span class="pl-kos">(</span><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'./Component'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-v">DynamicComponent</span><span class="pl-kos">;</span></pre></div> <p dir="auto">And you import it on a page with a regular import, HMR doesn't work:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import DynamicComponent from '../components/DynamicComponent.js'; export default () =&gt; ( &lt;div&gt; &lt;DynamicComponent /&gt; &lt;/div&gt; );"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">DynamicComponent</span> <span class="pl-k">from</span> <span class="pl-s">'../components/DynamicComponent.js'</span><span class="pl-kos">;</span> <span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span> <span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">DynamicComponent</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span> <span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p dir="auto">The rest of the dynamic import functionalities seem to work fine even on both cases, like SSR.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>next</td> <td>3.0.1-beta.18</td> </tr> <tr> <td>node</td> <td>6.10</td> </tr> <tr> <td>OS</td> <td>Sierra</td> </tr> <tr> <td>browser</td> <td>Chrome</td> </tr> </tbody> </table>
<h1 dir="auto">Bug report</h1> <h2 dir="auto">Describe the bug</h2> <p dir="auto">Build failed when importing firestore into Next app with error below (Error message attached below) :<br> <code class="notranslate">Module not found: Can't resolve 'memcpy' in /node_modules/bytebuffer/dist</code></p> <h2 dir="auto">To Reproduce</h2> <p dir="auto">Reproduce repo : <a href="https://github.com/charlesyeo92/test-next-firestore">https://github.com/charlesyeo92/test-next-firestore</a></p> <h2 dir="auto">Expected behavior</h2> <p dir="auto">Build should success.</p> <h2 dir="auto">Screenshots</h2> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8202917/61181223-deafb980-a655-11e9-9cbf-13c7f8742f81.png"><img src="https://user-images.githubusercontent.com/8202917/61181223-deafb980-a655-11e9-9cbf-13c7f8742f81.png" alt="image" style="max-width: 100%;"></a></p> <h2 dir="auto">System information</h2> <ul dir="auto"> <li>Version of Next.js: 9.0.1</li> <li>Version of @firebase/firestore: 1.4.4</li> </ul> <h2 dir="auto">Additional context</h2> <p dir="auto">However I was able to build successfully when removing <code class="notranslate">target: 'serverless'</code> from next.config.js.</p>
0
<p dir="auto">You can see this on the documentation site in Chrome and FF. When you hover over the active element in a nav-list, you get a gray background that obscures the text.</p> <p dir="auto">I looked for a quick fix, as this wasn't present in the 2.0-wip code I was using previously, but I'm still getting my bearings with the source and was unable to find anything obvious after a quick look around.</p>
<p dir="auto">here is the list of js files included</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;script src=&quot;js/jquery-1.7.1.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/bootstrap.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/bootstrap-dropdown.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/bootstrap-button.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;link href=&quot;css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;"><pre class="notranslate"><code class="notranslate">&lt;script src="js/jquery-1.7.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/bootstrap-dropdown.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/bootstrap-button.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" /&gt; </code></pre></div> <p dir="auto">here is the markup of the button</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;div class=&quot;btn-group&quot;&gt; &lt;a class=&quot;btn dropdown-toggle&quot; data-toggle=&quot;dropdown&quot; href=&quot;#&quot;&gt; Action &lt;span class=&quot;caret&quot;&gt;&lt;/span&gt; &lt;/a&gt; &lt;ul class=&quot;dropdown-menu&quot;&gt; &lt;!-- dropdown menu links --&gt; &lt;/ul&gt; &lt;/div&gt;"><pre class="notranslate"><code class="notranslate">&lt;div class="btn-group"&gt; &lt;a class="btn dropdown-toggle" data-toggle="dropdown" href="#"&gt; Action &lt;span class="caret"&gt;&lt;/span&gt; &lt;/a&gt; &lt;ul class="dropdown-menu"&gt; &lt;!-- dropdown menu links --&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre></div> <p dir="auto">Not sure, why the dropdown does not shows up when it should. am i missing something ?</p>
0
<p dir="auto">I'm not sure if this is desired behavior or not, but the two functions currently have inconsistent output. It would be nice for <code class="notranslate">pmap()</code> to preserve shape too.</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; map(prod, Base.product(1:5, 1:5)) 5×5 Array{Int64,2}: 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 julia&gt; pmap(prod, Base.product(1:5, 1:5)) 25-element Array{Any,1}: 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">map</span>(prod, Base<span class="pl-k">.</span><span class="pl-c1">product</span>(<span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span>, <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span>)) <span class="pl-c1">5</span><span class="pl-k">×</span><span class="pl-c1">5</span> Array{Int64,<span class="pl-c1">2</span>}<span class="pl-k">:</span> <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">3</span> <span class="pl-c1">4</span> <span class="pl-c1">5</span> <span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">6</span> <span class="pl-c1">8</span> <span class="pl-c1">10</span> <span class="pl-c1">3</span> <span class="pl-c1">6</span> <span class="pl-c1">9</span> <span class="pl-c1">12</span> <span class="pl-c1">15</span> <span class="pl-c1">4</span> <span class="pl-c1">8</span> <span class="pl-c1">12</span> <span class="pl-c1">16</span> <span class="pl-c1">20</span> <span class="pl-c1">5</span> <span class="pl-c1">10</span> <span class="pl-c1">15</span> <span class="pl-c1">20</span> <span class="pl-c1">25</span> julia<span class="pl-k">&gt;</span> <span class="pl-c1">pmap</span>(prod, Base<span class="pl-k">.</span><span class="pl-c1">product</span>(<span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span>, <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">5</span>)) <span class="pl-c1">25</span><span class="pl-k">-</span>element Array{Any,<span class="pl-c1">1</span>}<span class="pl-k">:</span> <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">3</span> <span class="pl-c1">4</span> <span class="pl-c1">5</span> <span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">6</span> <span class="pl-c1">8</span> <span class="pl-c1">10</span> <span class="pl-c1">3</span> <span class="pl-c1">6</span> <span class="pl-c1">9</span> <span class="pl-c1">12</span> <span class="pl-c1">15</span> <span class="pl-c1">4</span> <span class="pl-c1">8</span> <span class="pl-c1">12</span> <span class="pl-c1">16</span> <span class="pl-c1">20</span> <span class="pl-c1">5</span> <span class="pl-c1">10</span> <span class="pl-c1">15</span> <span class="pl-c1">20</span> <span class="pl-c1">25</span></pre></div>
<p dir="auto">As discussed on the julia-users mailing list thread "parallelized comprehensions"<br> <a href="https://groups.google.com/forum/#!topic/julia-users/DTyTqib3iOk" rel="nofollow">https://groups.google.com/forum/#!topic/julia-users/DTyTqib3iOk</a><br> map preserves the shape of the input and does type deduction, whereas pmap does not:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; map(x -&gt; x.^2, 2*ones(2,2)) 2x2 Array{Float64,2}: 4.0 4.0 4.0 4.0 julia&gt; pmap(x -&gt; x.^2, 2*ones(2,2)) 4-element Array{Any,1}: 4.0 4.0 4.0 4.0"><pre class="notranslate"><code class="notranslate">julia&gt; map(x -&gt; x.^2, 2*ones(2,2)) 2x2 Array{Float64,2}: 4.0 4.0 4.0 4.0 julia&gt; pmap(x -&gt; x.^2, 2*ones(2,2)) 4-element Array{Any,1}: 4.0 4.0 4.0 4.0 </code></pre></div> <p dir="auto">From a user's perspective it would be good if both functions had the same interface.</p>
1
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Plazik/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Plazik">@Plazik</a> on 2016-11-03T13:19:28Z</p> <h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">apt</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0 config file = /home/vagrant/my/ansible.cfg configured module search path = Default w/o overrides "><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0 config file = /home/vagrant/my/ansible.cfg configured module search path = Default w/o overrides </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <p dir="auto">ansible.cfg:<br> [defaults]<br> hostfile = hosts</p> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">OS you are running Ansible from: Ubuntu 16.04<br> OS you are managing: Ubuntu 16.04</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">After upgradig to ansible 2.2 I always get changes in apt module because it ignore <strong>cache_valid_time</strong> value.</p> <h5 dir="auto">STEPS TO REPRODUCE</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test.yml: --- - hosts: localvm become: yes tasks: - name: Only run &quot;update_cache=yes&quot; if the last one is more than 3600 seconds ago apt: update_cache: yes cache_valid_time: 3600 vagrant@ans-contrl:~/my$ ansible-playbook test.yml -vvv"><pre class="notranslate"><code class="notranslate">test.yml: --- - hosts: localvm become: yes tasks: - name: Only run "update_cache=yes" if the last one is more than 3600 seconds ago apt: update_cache: yes cache_valid_time: 3600 vagrant@ans-contrl:~/my$ ansible-playbook test.yml -vvv </code></pre></div> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">Update apt cache on first run, skip updating cache on second run.</p> <h5 dir="auto">ACTUAL RESULTS</h5> <p dir="auto">Always changes.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="vagrant@ans-contrl:~/my$ ansible-playbook test.yml -vvv Using /home/vagrant/my/ansible.cfg as config file PLAYBOOK: test.yml ************************************************************* 1 plays in test.yml PLAY [localvm] ***************************************************************** TASK [setup] ******************************************************************* Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/system/setup.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329 `&quot; &amp;&amp; echo ansible-tmp-1478178800.59-26361197346329=&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329 `&quot; ) &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; PUT /tmp/tmpGz1Eb9 TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/setup.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/setup.py &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '&quot;'&quot;'sudo -H -S -n -u root /bin/sh -c '&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'echo BECOME-SUCCESS-bblyfpmawwxwihkyhdzgsrwimfkjlzuk; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/setup.py; rm -rf &quot;/home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;' &amp;&amp; sleep 0'&quot;'&quot;'' ok: [192.168.60.4] TASK [Only run &quot;update_cache=yes&quot; if the last one is more than 3600 seconds ago] *** task path: /home/vagrant/my/test.yml:6 Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/packaging/os/apt.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469 `&quot; &amp;&amp; echo ansible-tmp-1478178801.29-209769775274469=&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469 `&quot; ) &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; PUT /tmp/tmpb8HOiL TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/apt.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/apt.py &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '&quot;'&quot;'sudo -H -S -n -u root /bin/sh -c '&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'echo BECOME-SUCCESS-soyskgemfitdsrhonujvdopjieqzexmq; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/apt.py; rm -rf &quot;/home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;' &amp;&amp; sleep 0'&quot;'&quot;'' changed: [192.168.60.4] =&gt; { &quot;cache_update_time&quot;: 1478170123, &quot;cache_updated&quot;: true, &quot;changed&quot;: true, &quot;invocation&quot;: { &quot;module_args&quot;: { &quot;allow_unauthenticated&quot;: false, &quot;autoremove&quot;: false, &quot;cache_valid_time&quot;: 3600, &quot;deb&quot;: null, &quot;default_release&quot;: null, &quot;dpkg_options&quot;: &quot;force-confdef,force-confold&quot;, &quot;force&quot;: false, &quot;install_recommends&quot;: null, &quot;only_upgrade&quot;: false, &quot;package&quot;: null, &quot;purge&quot;: false, &quot;state&quot;: &quot;present&quot;, &quot;update_cache&quot;: true, &quot;upgrade&quot;: null }, &quot;module_name&quot;: &quot;apt&quot; } } PLAY RECAP ********************************************************************* 192.168.60.4 : ok=2 changed=1 unreachable=0 failed=0 vagrant@ans-contrl:~/my$ ansible-playbook test.yml -vvv Using /home/vagrant/my/ansible.cfg as config file PLAYBOOK: test.yml ************************************************************* 1 plays in test.yml PLAY [localvm] ***************************************************************** TASK [setup] ******************************************************************* Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/system/setup.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023 `&quot; &amp;&amp; echo ansible-tmp-1478178871.45-218992397586023=&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023 `&quot; ) &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; PUT /tmp/tmpv9o0e3 TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/setup.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/setup.py &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '&quot;'&quot;'sudo -H -S -n -u root /bin/sh -c '&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'echo BECOME-SUCCESS-lwuttqhzswvnqlvkfcbraivcbuceisuz; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/setup.py; rm -rf &quot;/home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;' &amp;&amp; sleep 0'&quot;'&quot;'' ok: [192.168.60.4] TASK [Only run &quot;update_cache=yes&quot; if the last one is more than 3600 seconds ago] *** task path: /home/vagrant/my/test.yml:6 Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/packaging/os/apt.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646 `&quot; &amp;&amp; echo ansible-tmp-1478178872.37-148384000832646=&quot;` echo $HOME/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646 `&quot; ) &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; PUT /tmp/tmp3rCfzf TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/apt.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '&quot;'&quot;'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/apt.py &amp;&amp; sleep 0'&quot;'&quot;'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '&quot;'&quot;'sudo -H -S -n -u root /bin/sh -c '&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'echo BECOME-SUCCESS-xhjxsxornuzelhyvlsiksuindfcmjlpx; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/apt.py; rm -rf &quot;/home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/&quot; &gt; /dev/null 2&gt;&amp;1'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;'&quot;' &amp;&amp; sleep 0'&quot;'&quot;'' changed: [192.168.60.4] =&gt; { &quot;cache_update_time&quot;: 1478170123, &quot;cache_updated&quot;: true, &quot;changed&quot;: true, &quot;invocation&quot;: { &quot;module_args&quot;: { &quot;allow_unauthenticated&quot;: false, &quot;autoremove&quot;: false, &quot;cache_valid_time&quot;: 3600, &quot;deb&quot;: null, &quot;default_release&quot;: null, &quot;dpkg_options&quot;: &quot;force-confdef,force-confold&quot;, &quot;force&quot;: false, &quot;install_recommends&quot;: null, &quot;only_upgrade&quot;: false, &quot;package&quot;: null, &quot;purge&quot;: false, &quot;state&quot;: &quot;present&quot;, &quot;update_cache&quot;: true, &quot;upgrade&quot;: null }, &quot;module_name&quot;: &quot;apt&quot; } } PLAY RECAP ********************************************************************* 192.168.60.4 : ok=2 changed=1 unreachable=0 failed=0 "><pre class="notranslate"><code class="notranslate">vagrant@ans-contrl:~/my$ ansible-playbook test.yml -vvv Using /home/vagrant/my/ansible.cfg as config file PLAYBOOK: test.yml ************************************************************* 1 plays in test.yml PLAY [localvm] ***************************************************************** TASK [setup] ******************************************************************* Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/system/setup.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329 `" &amp;&amp; echo ansible-tmp-1478178800.59-26361197346329="` echo $HOME/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329 `" ) &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; PUT /tmp/tmpGz1Eb9 TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/setup.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/setup.py &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-bblyfpmawwxwihkyhdzgsrwimfkjlzuk; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/setup.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1478178800.59-26361197346329/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"'' ok: [192.168.60.4] TASK [Only run "update_cache=yes" if the last one is more than 3600 seconds ago] *** task path: /home/vagrant/my/test.yml:6 Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/packaging/os/apt.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469 `" &amp;&amp; echo ansible-tmp-1478178801.29-209769775274469="` echo $HOME/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469 `" ) &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; PUT /tmp/tmpb8HOiL TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/apt.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/apt.py &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-soyskgemfitdsrhonujvdopjieqzexmq; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/apt.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1478178801.29-209769775274469/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"'' changed: [192.168.60.4] =&gt; { "cache_update_time": 1478170123, "cache_updated": true, "changed": true, "invocation": { "module_args": { "allow_unauthenticated": false, "autoremove": false, "cache_valid_time": 3600, "deb": null, "default_release": null, "dpkg_options": "force-confdef,force-confold", "force": false, "install_recommends": null, "only_upgrade": false, "package": null, "purge": false, "state": "present", "update_cache": true, "upgrade": null }, "module_name": "apt" } } PLAY RECAP ********************************************************************* 192.168.60.4 : ok=2 changed=1 unreachable=0 failed=0 vagrant@ans-contrl:~/my$ ansible-playbook test.yml -vvv Using /home/vagrant/my/ansible.cfg as config file PLAYBOOK: test.yml ************************************************************* 1 plays in test.yml PLAY [localvm] ***************************************************************** TASK [setup] ******************************************************************* Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/system/setup.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023 `" &amp;&amp; echo ansible-tmp-1478178871.45-218992397586023="` echo $HOME/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023 `" ) &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; PUT /tmp/tmpv9o0e3 TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/setup.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/setup.py &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-lwuttqhzswvnqlvkfcbraivcbuceisuz; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/setup.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1478178871.45-218992397586023/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"'' ok: [192.168.60.4] TASK [Only run "update_cache=yes" if the last one is more than 3600 seconds ago] *** task path: /home/vagrant/my/test.yml:6 Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/packaging/os/apt.py &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646 `" &amp;&amp; echo ansible-tmp-1478178872.37-148384000832646="` echo $HOME/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646 `" ) &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; PUT /tmp/tmp3rCfzf TO /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/apt.py &lt;192.168.60.4&gt; SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.60.4]' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.60.4 '/bin/sh -c '"'"'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/ /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/apt.py &amp;&amp; sleep 0'"'"'' &lt;192.168.60.4&gt; ESTABLISH SSH CONNECTION FOR USER: vagrant &lt;192.168.60.4&gt; SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.60.4 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-xhjxsxornuzelhyvlsiksuindfcmjlpx; /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/apt.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1478178872.37-148384000832646/" &gt; /dev/null 2&gt;&amp;1'"'"'"'"'"'"'"'"' &amp;&amp; sleep 0'"'"'' changed: [192.168.60.4] =&gt; { "cache_update_time": 1478170123, "cache_updated": true, "changed": true, "invocation": { "module_args": { "allow_unauthenticated": false, "autoremove": false, "cache_valid_time": 3600, "deb": null, "default_release": null, "dpkg_options": "force-confdef,force-confold", "force": false, "install_recommends": null, "only_upgrade": false, "package": null, "purge": false, "state": "present", "update_cache": true, "upgrade": null }, "module_name": "apt" } } PLAY RECAP ********************************************************************* 192.168.60.4 : ok=2 changed=1 unreachable=0 failed=0 </code></pre></div> <p dir="auto">It seems <strong>cache_update_time</strong> didn't updated.<br> Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="187057383" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/5468" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/5468/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/5468">ansible/ansible-modules-core#5468</a></p>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ahes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ahes">@ahes</a> on 2016-11-08T16:10:24Z</p> <h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Bug Report</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">apt</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0 </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <p dir="auto">Default</p> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">Debian Jessie 64 GNU/Linux</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">When installing packages and using update_cache option apt module always returns state CHANGED even if packages are already installed.</p> <p dir="auto">In my opinion expected behavior would be:</p> <ol dir="auto"> <li>when using update_cache AND installing package(s) return status CHANGED only when package has been installed or updated, no matter if cache has been updated or not.</li> <li>when using update_cache without installing any package(s) return status CHANGED when cache has been updated.</li> </ol> <h5 dir="auto">STEPS TO REPRODUCE</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" --- - hosts: localhost gather_facts: no become: yes tasks: - apt: name: htop update_cache: yes"><pre class="notranslate"><code class="notranslate"> --- - hosts: localhost gather_facts: no become: yes tasks: - apt: name: htop update_cache: yes </code></pre></div> <h5 dir="auto">EXPECTED RESULTS</h5> <p dir="auto">As in ansible 2.1:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] *************************************************************** TASK [apt] ********************************************************************* ok: [localhost] PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=0"><pre class="notranslate"><code class="notranslate">PLAY [localhost] *************************************************************** TASK [apt] ********************************************************************* ok: [localhost] PLAY RECAP ********************************************************************* localhost : ok=1 changed=0 unreachable=0 failed=0 </code></pre></div> <p dir="auto">Part of debug output:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ok: [localhost] =&gt; {&quot;cache_update_time&quot;: 1478621386, &quot;cache_updated&quot;: true, &quot;changed&quot;: false, &quot;invocation&quot;: {&quot;module_args&quot;: {&quot;allow_unauthenticated&quot;: false, &quot;autoremove&quot;: false, &quot;cache_valid_time&quot;: null, &quot;deb&quot;: null, &quot;default_release&quot;: null, &quot;dpkg_options&quot;: &quot;force-confdef,force-confold&quot;, &quot;force&quot;: false, &quot;install_recommends&quot;: null, &quot;name&quot;: &quot;htop&quot;, &quot;only_upgrade&quot;: false, &quot;package&quot;: [&quot;htop&quot;], &quot;purge&quot;: false, &quot;state&quot;: &quot;present&quot;, &quot;update_cache&quot;: true, &quot;upgrade&quot;: null}, &quot;module_name&quot;: &quot;apt&quot;}}"><pre class="notranslate"><code class="notranslate">ok: [localhost] =&gt; {"cache_update_time": 1478621386, "cache_updated": true, "changed": false, "invocation": {"module_args": {"allow_unauthenticated": false, "autoremove": false, "cache_valid_time": null, "deb": null, "default_release": null, "dpkg_options": "force-confdef,force-confold", "force": false, "install_recommends": null, "name": "htop", "only_upgrade": false, "package": ["htop"], "purge": false, "state": "present", "update_cache": true, "upgrade": null}, "module_name": "apt"}} </code></pre></div> <h5 dir="auto">ACTUAL RESULTS</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [localhost] *************************************************************** TASK [apt] ********************************************************************* changed: [localhost] PLAY RECAP ********************************************************************* localhost : ok=1 changed=1 unreachable=0 failed=0"><pre class="notranslate"><code class="notranslate">PLAY [localhost] *************************************************************** TASK [apt] ********************************************************************* changed: [localhost] PLAY RECAP ********************************************************************* localhost : ok=1 changed=1 unreachable=0 failed=0 </code></pre></div> <p dir="auto">Part of debug output:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="changed: [localhost] =&gt; { &quot;cache_update_time&quot;: 1478621193, &quot;cache_updated&quot;: true, &quot;changed&quot;: true, &quot;invocation&quot;: { &quot;module_args&quot;: { &quot;allow_unauthenticated&quot;: false, &quot;autoremove&quot;: false, &quot;cache_valid_time&quot;: 0, &quot;deb&quot;: null, &quot;default_release&quot;: null, &quot;dpkg_options&quot;: &quot;force-confdef,force-confold&quot;, &quot;force&quot;: false, &quot;install_recommends&quot;: null, &quot;name&quot;: &quot;htop&quot;, &quot;only_upgrade&quot;: false, &quot;package&quot;: [ &quot;htop&quot; ], &quot;purge&quot;: false, &quot;state&quot;: &quot;present&quot;, &quot;update_cache&quot;: true, &quot;upgrade&quot;: null }, &quot;module_name&quot;: &quot;apt&quot; } }"><pre class="notranslate"><code class="notranslate">changed: [localhost] =&gt; { "cache_update_time": 1478621193, "cache_updated": true, "changed": true, "invocation": { "module_args": { "allow_unauthenticated": false, "autoremove": false, "cache_valid_time": 0, "deb": null, "default_release": null, "dpkg_options": "force-confdef,force-confold", "force": false, "install_recommends": null, "name": "htop", "only_upgrade": false, "package": [ "htop" ], "purge": false, "state": "present", "update_cache": true, "upgrade": null }, "module_name": "apt" } } </code></pre></div> <p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="188033702" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/5532" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/5532/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/5532">ansible/ansible-modules-core#5532</a></p>
1
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.): yes, but there seems to be a bug</p> <p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):</p> <h2 dir="auto">kubernetes delete daemonset fails</h2> <p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):</p> <p dir="auto">BUG REPORT</p> <p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kubectl version Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;3&quot;, GitVersion:&quot;v1.3.4&quot;, GitCommit:&quot;dd6b458ef8dbf24aff55795baa68f83383c9b3a9&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-08-01T16:45:16Z&quot;, GoVersion:&quot;go1.6.2&quot;, Compiler:&quot;gc&quot;, Platform:&quot;darwin/amd64&quot;} Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;3&quot;, GitVersion:&quot;v1.3.4&quot;, GitCommit:&quot;dd6b458ef8dbf24aff55795baa68f83383c9b3a9&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-08-01T16:38:31Z&quot;, GoVersion:&quot;go1.6.2&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}"><pre class="notranslate"><code class="notranslate">kubectl version Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:45:16Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.4", GitCommit:"dd6b458ef8dbf24aff55795baa68f83383c9b3a9", GitTreeState:"clean", BuildDate:"2016-08-01T16:38:31Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"} </code></pre></div> <p dir="auto"><strong>Environment</strong>:</p> <ul dir="auto"> <li><strong>Cloud provider or hardware configuration</strong>: AWS</li> <li><strong>OS</strong> (e.g. from /etc/os-release): Debian GNU/Linux 8 (jessie)</li> <li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux ip-172-20-105-42 3.16.0-4-amd64 <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1">#1</a> SMP Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux</li> <li><strong>Install tools</strong>: kops</li> <li><strong>Others</strong>:</li> </ul> <p dir="auto"><strong>What happened</strong>:<br> I have ingress running as a daemonset, looking for a nodeSelector:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" nodeSelector: roles.kubernetes.io/node: &quot;1&quot;"><pre class="notranslate"><code class="notranslate"> nodeSelector: roles.kubernetes.io/node: "1" </code></pre></div> <p dir="auto">I am updating it to have a TCP services config map, so I needed to delete the daemonset first.<br> Ran: <code class="notranslate">kubectl delete ds nginx-ingress-controller --namespace=kube-system</code><br> And waited.</p> <p dir="auto">Eventually, it failed with <code class="notranslate">error: timed out waiting for the condition</code></p> <p dir="auto">But <code class="notranslate">kubectl get pods --namespace=kube-system -w</code> shows that the pods are being terminated, and then being recreated.</p> <p dir="auto"><strong>What you expected to happen</strong>:<br> All pods and the daemonset should be deleted.</p> <p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):<br> I have no idea.</p> <p dir="auto"><strong>Anything else do we need to know</strong>:<br> Not sure.</p>
<p dir="auto">We have a bunch of different controllers already and (at least now) they are running on a single binary.</p> <p dir="auto">While looking into logs (in apiserver) one can see that a bunch of them are doing very similar operations at the same time, e.g.:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I1002 11:46:31.421115 12 handlers.go:130] GET /api/v1/pods: (1.325473918s) 200 [[kube-controller-manager/v1.1.0 (linux/amd64) kubernetes/521c67a] 127.0.0.1:48235] I1002 11:46:31.425218 12 handlers.go:130] GET /api/v1/pods: (1.329777158s) 200 [[kube-controller-manager/v1.1.0 (linux/amd64) kubernetes/521c67a] 127.0.0.1:48234] I1002 11:46:31.456389 12 handlers.go:130] GET /api/v1/pods: (1.360542647s) 200 [[kube-controller-manager/v1.1.0 (linux/amd64) kubernetes/521c67a] 127.0.0.1:48236]"><pre class="notranslate"><code class="notranslate">I1002 11:46:31.421115 12 handlers.go:130] GET /api/v1/pods: (1.325473918s) 200 [[kube-controller-manager/v1.1.0 (linux/amd64) kubernetes/521c67a] 127.0.0.1:48235] I1002 11:46:31.425218 12 handlers.go:130] GET /api/v1/pods: (1.329777158s) 200 [[kube-controller-manager/v1.1.0 (linux/amd64) kubernetes/521c67a] 127.0.0.1:48234] I1002 11:46:31.456389 12 handlers.go:130] GET /api/v1/pods: (1.360542647s) 200 [[kube-controller-manager/v1.1.0 (linux/amd64) kubernetes/521c67a] 127.0.0.1:48236] </code></pre></div> <p dir="auto">In the above example, there are 3 "list pods" opertion send at the same time (those are comming from EndpointController, JobController and ReplicationController).<br> This seems to be a waster of resource (both cpu, memory and network).</p> <p dir="auto">We should try to have one "store" per resource and share it between different controllers (that will be able to register their callbacks on that store).<br> Thoughts?</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lavalamp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lavalamp">@lavalamp</a> @kubernetes/goog-csi <a class="team-mention js-team-mention notranslate" data-error-text="Failed to load team members" data-id="3959732" data-permission-text="Team members are private" data-url="/orgs/kubernetes/teams/sig-scalability/members" data-hovercard-type="team" data-hovercard-url="/orgs/kubernetes/teams/sig-scalability/hovercard" href="https://github.com/orgs/kubernetes/teams/sig-scalability">@kubernetes/sig-scalability</a></p>
0
<p dir="auto">I noticed a problem when wanting to have a TextField selection and then replacing the selected text when typing.</p> <p dir="auto">I tried the Flutter Gallery app v0.5.1 and it has the same problem.</p> <h2 dir="auto">Steps to Reproduce</h2> <ol dir="auto"> <li>Open Flutter Gallery v0.5.1</li> <li>Go to Material -&gt; Text fields</li> <li>Write something in the Salary input</li> <li>Select some numbers and then start writing new ones</li> </ol> <p dir="auto">I would expect the selected text to be replaced by the new one but instead it is added before the selection. The same behavior is seen on TextInputType.number and TextInputType.phone but not on TextInputType.text for example.</p> <h2 dir="auto">Logs</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<p dir="auto">i write chat on websocket, I do not have access to the socket connection state, I found states in private sources(connecting, open etc)</p> <p dir="auto">in current implementation unclear, client connected to socket or performed connection.</p> <p dir="auto">in below example , onDone called with long delay, although pong not received and socket closed.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var channel = IOWebSocketChannel.connect('ws://echo.websocket.org', pingInterval: Duration(milliseconds: 1000)); channel.stream.listen((d) { print(d); }, onDone: () { print('done'); }, onError: (error) { print(error); });"><pre class="notranslate"><code class="notranslate">var channel = IOWebSocketChannel.connect('ws://echo.websocket.org', pingInterval: Duration(milliseconds: 1000)); channel.stream.listen((d) { print(d); }, onDone: () { print('done'); }, onError: (error) { print(error); }); </code></pre></div> <p dir="auto">what I want: example, stream of connection state(connecting, connected, error, closed, etc)<br> i subscribed in page for change ui state(example show connection indicator(color dot). or make access to socket state, and run Timer with checking it value.</p>
0
<pre class="notranslate">Before filing a bug, please check whether it has been fixed since the latest release. Search the issue tracker and check that you're running the latest version of Go: Run "go version" and compare against <a href="http://golang.org/doc/devel/release.html" rel="nofollow">http://golang.org/doc/devel/release.html</a> If a newer version of Go exists, install it and retry what you did to reproduce the problem. Thanks. What does 'go version' print? go version go1.2.2 darwin/amd64 What steps reproduce the problem? If possible, include a link to a program on play.golang.org. <a href="http://play.golang.org/p/AJ1eY19nWS" rel="nofollow">http://play.golang.org/p/AJ1eY19nWS</a> What happened? This error is printed when building: "main.main: doasm: notfound from=75 to=75 (4) CMPQ $0,$0" What should have happened instead? It should compile and link successfully. Please provide any additional information below. With go release version mentioned above, "go tool 6g foo.go" succeeds, and then "go tool 6l foo.6" produces the error above. With tip (go version devel +b5eda189b974 Thu Feb 20 16:18:05 2014 -0500 darwin/amd64), "go tool 6g foo.go" fails with basically the same error, though formatted slightly differently: "foo.go:5: doasm: notfound from=75 to=75 00000 (foo.go:4) CMPQ $0,$0"</pre>
<pre class="notranslate">The following declaration type E interface { E } is accepted by neither the gc collection of compilers nor gccgo (interface type loop involving E). Arguably it is a legal declaration; at least there is no wording in the spec against it. This is either a) a compiler bug, or b) the spec needs to be clearer. Also, this is a completely academic issue with no practical implications...</pre>
0
<ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate. But I think it is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="231794266" data-permission-text="Title is private" data-url="https://github.com/mui/material-ui/issues/6971" data-hovercard-type="issue" data-hovercard-url="/mui/material-ui/issues/6971/hovercard" href="https://github.com/mui/material-ui/issues/6971">#6971</a></li> </ul> <p dir="auto">I currently use snapshot testing for a project, but it seems like as soon as i'm using a component which relies on material-ui/Button the tests fail with.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Invariant Violation: getNodeFromInstance: Invalid argument. at invariant (node_modules/fbjs/lib/invariant.js:42:15) at Object.getNodeFromInstance (node_modules/react-dom/lib/ReactDOMComponentTree.js:160:77) at findDOMNode (node_modules/react-dom/lib/findDOMNode.js:47:41) at ButtonBase.componentDidMount (node_modules/material-ui/ButtonBase/ButtonBase.js:222:47) at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:262:25 at measureLifeCyclePerf (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:73:12) at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:261:11 at CallbackQueue.notifyAll (node_modules/react-test-renderer/lib/CallbackQueue.js:74:22) at ReactTestReconcileTransaction.close (node_modules/react-test-renderer/lib/ReactTestReconcileTransaction.js:34:26) at ReactTestReconcileTransaction.closeAll (node_modules/react-test-renderer/lib/Transaction.js:207:25) at ReactTestReconcileTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:154:16) at batchedMountComponentIntoNode (node_modules/react-test-renderer/lib/ReactTestMount.js:67:27) at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:141:20) at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactDefaultBatchingStrategy.js:60:26) at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactUpdates.js:95:27) at Object.render [as create] (node_modules/react-test-renderer/lib/ReactTestMount.js:126:18) at Object.test (node_modules/@storybook/addon-storyshots/dist/test-bodies.js:26:44) at Object.&lt;anonymous&gt; (node_modules/@storybook/addon-storyshots/dist/index.js:145:21) at Promise (&lt;anonymous&gt;) at &lt;anonymous&gt; "><pre class="notranslate"><code class="notranslate">Invariant Violation: getNodeFromInstance: Invalid argument. at invariant (node_modules/fbjs/lib/invariant.js:42:15) at Object.getNodeFromInstance (node_modules/react-dom/lib/ReactDOMComponentTree.js:160:77) at findDOMNode (node_modules/react-dom/lib/findDOMNode.js:47:41) at ButtonBase.componentDidMount (node_modules/material-ui/ButtonBase/ButtonBase.js:222:47) at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:262:25 at measureLifeCyclePerf (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:73:12) at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:261:11 at CallbackQueue.notifyAll (node_modules/react-test-renderer/lib/CallbackQueue.js:74:22) at ReactTestReconcileTransaction.close (node_modules/react-test-renderer/lib/ReactTestReconcileTransaction.js:34:26) at ReactTestReconcileTransaction.closeAll (node_modules/react-test-renderer/lib/Transaction.js:207:25) at ReactTestReconcileTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:154:16) at batchedMountComponentIntoNode (node_modules/react-test-renderer/lib/ReactTestMount.js:67:27) at ReactDefaultBatchingStrategyTransaction.perform (node_modules/react-test-renderer/lib/Transaction.js:141:20) at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactDefaultBatchingStrategy.js:60:26) at Object.batchedUpdates (node_modules/react-test-renderer/lib/ReactUpdates.js:95:27) at Object.render [as create] (node_modules/react-test-renderer/lib/ReactTestMount.js:126:18) at Object.test (node_modules/@storybook/addon-storyshots/dist/test-bodies.js:26:44) at Object.&lt;anonymous&gt; (node_modules/@storybook/addon-storyshots/dist/index.js:145:21) at Promise (&lt;anonymous&gt;) at &lt;anonymous&gt; </code></pre></div> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">Snapshot testing is possible with all components.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">Snapshot testing isn't possible for some components.</p> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <p dir="auto">Write a snapshot test for e.g. <code class="notranslate">import Hidden from 'material-ui/Hidden';</code> and one for <code class="notranslate">import Button from 'material-ui/Button';</code> (is there a pastebin which is capable of this?)</p> <h2 dir="auto">Context</h2> <p dir="auto">I tried using storyshots for snapshot testing of components using material-ui components.</p> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>beta.17</td> </tr> <tr> <td>React</td> <td>15.6</td> </tr> </tbody> </table>
<p dir="auto">I try to destroy my React application using "unmountComponentAtNode" I get an error when my app includes a Dialog component.</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li> </ul> <h2 dir="auto">Expected Behavior</h2> <p dir="auto">Application unmounted without errors.</p> <h2 dir="auto">Current Behavior</h2> <p dir="auto">These errors:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. index.js:2177 The above error occurred in the &lt;DialogInline&gt; component: in DialogInline"><pre class="notranslate"><code class="notranslate">Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. index.js:2177 The above error occurred in the &lt;DialogInline&gt; component: in DialogInline </code></pre></div> <h2 dir="auto">Steps to Reproduce (for bugs)</h2> <p dir="auto"><a href="https://codesandbox.io/s/7mojo3pzzq" rel="nofollow">https://codesandbox.io/s/7mojo3pzzq</a> (project not working for some reason)</p> <ol dir="auto"> <li>Call unmountComponentAtNode</li> </ol> <h2 dir="auto">Context</h2> <p dir="auto">I'm trying to unmount a React application that has a Dialog.</p> <h2 dir="auto">Your Environment</h2> <table role="table"> <thead> <tr> <th>Tech</th> <th>Version</th> </tr> </thead> <tbody> <tr> <td>Material-UI</td> <td>0.20.0</td> </tr> <tr> <td>React</td> <td>16.2.0</td> </tr> <tr> <td>browser</td> <td>Any</td> </tr> </tbody> </table>
0
<h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3> <h3 dir="auto">Environment info</h3> <p dir="auto">Operating System: Mac OS X EI captain 10.11.6</p> <p dir="auto">Installed version of CUDA and cuDNN:<br> No</p> <p dir="auto">If installed from binary pip package, provide:</p> <ol dir="auto"> <li>A link to the pip package you installed:<br> I install tensorflow from source following this site: <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile">https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile</a></li> <li>The output from <code class="notranslate">python -c "import tensorflow; print(tensorflow.__version__)"</code>.<br> But It seems i cant get the tensorflow version command, there is no module named tensorflow; I also installed tensorflow with docker on my Mac.</li> </ol> <p dir="auto">If installed from source, provide</p> <ol dir="auto"> <li>The commit hash (<code class="notranslate">git rev-parse HEAD</code>)<br> <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/6218ac2be3cc530da866ec32da4cb86c6ac5bb85/hovercard" href="https://github.com/tensorflow/tensorflow/commit/6218ac2be3cc530da866ec32da4cb86c6ac5bb85"><tt>6218ac2</tt></a></li> <li>The output of <code class="notranslate">bazel version</code><br> Build label: 0.3.1-homebrew<br> Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar<br> Build time: Thu Aug 4 09:58:27 2016 (1470304707)<br> Build timestamp: 1470304707<br> Build timestamp as int: 1470304707</li> </ol> <h3 dir="auto">What other attempted solutions have you tried?</h3> <p dir="auto">Search on stackoverflow</p> <p dir="auto">I followed the ios_example from here, <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ios_examples">https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/ios_examples</a><br> I successfully installed the static library containing the core code of tensorflow;<br> I downloaded the incetption v1, and I have xcode 7.3.1 installed on my Mac;<br> When I launch xcode from tf_ios_makefile_example.xcodeproj in the subfolder tensorflow/tensorflow/contrib/ios_examples/simple, I got un error:</p> <h1 dir="auto">include "unsupported/Eigen/CXX11/Tensor"</h1> <p dir="auto">What did I miss? the version of eigen is not right? I do install eigen.</p> <p dir="auto">Any suggestion will be appreciated<br> Thanks</p>
<h3 dir="auto">Environment info</h3> <p dir="auto">Operating System: Ubuntu 14.04</p> <p dir="auto">I'm trying to build the pi-examples by building the tensorflow via makefile on Linux(Ubuntu 14.04).</p> <p dir="auto">So 1st I've done "Building on Linux" successfully from here: <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile#building-on-linux">https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile#building-on-linux</a></p> <p dir="auto">now at <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/pi_examples">https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/pi_examples</a> I'm trying to build camera example, but when I've run <code class="notranslate">make -f tensorflow/contrib/pi_examples/camera/Makefile</code> command, the result came out as follows on terminal:</p> <p dir="auto"><code class="notranslate">gcc --std=c++11 -O0 -I/usr/local/include -I. -I/home/tushar/Desktop/tushar/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/downloads -I/home/tushar/Desktop/tushar/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/downloads/eigen-latest/ -I/home/tushar/Desktop/tushar/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/gen/proto/ -I/home/tushar/Desktop/tushar/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/gen/proto_text/ -c tensorflow/contrib/pi_examples/camera/camera.cc -o /home/tushar/Desktop/tushar/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o In file included from ./tensorflow/core/framework/tensor.h:19:0, from tensorflow/contrib/pi_examples/camera/camera.cc:33: ./third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1:42: fatal error: unsupported/Eigen/CXX11/Tensor: No such file or directory #include "unsupported/Eigen/CXX11/Tensor" ^ compilation terminated. make: *** [/home/tushar/Desktop/tushar/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o] Error 1 </code></p> <p dir="auto">Why? could anyone confirm me that third-party library specially (eigen3) is complete or something missing.</p> <p dir="auto">I've also tried with replacing it's third-party eigen3 library by separately downloaded library, but that create new error, but similar to this (i.e. XYZ... No such file or directory)</p>
1
<p dir="auto">How to maximize the page in playwright?</p>
<p dir="auto">Selenium feature: <a href="https://www.selenium.dev/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html#selenium.webdriver.remote.webdriver.WebDriver.maximize_window" rel="nofollow">https://www.selenium.dev/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html#selenium.webdriver.remote.webdriver.WebDriver.maximize_window</a></p> <p dir="auto">Requested via Slack.</p> <p dir="auto">Scenario: Automate a website and then let the user complete something. Its great if the max possible width/height could be determined so the user has "maximum available viewport".</p> <p dir="auto">But not sure how or if its easy implementable since we in CR e.g. emulate the viewport independent from the window size.</p> <p dir="auto">For Chromium it works already like that:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// @ts-check const playwright = require('playwright'); (async () =&gt; { const browser = await playwright.chromium.launch({ args: [&quot;--start-maximized&quot;], headless: false, }); const context = await browser.newContext({ viewport: null }); const page = await context.newPage(); await page.goto('http://whatsmyuseragent.org/'); await browser.close(); })();"><pre class="notranslate"><span class="pl-c">// <span class="pl-k">@ts</span>-check</span> <span class="pl-k">const</span> <span class="pl-s1">playwright</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</span><span class="pl-kos">.</span><span class="pl-c1">chromium</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">"--start-maximized"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newContext</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">viewport</span>: <span class="pl-c1">null</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'http://whatsmyuseragent.org/'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
1
<h2 dir="auto"><g-emoji class="g-emoji" alias="information_source" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/2139.png">ℹ</g-emoji> Computer information</h2> <ul dir="auto"> <li>PowerToys version: 0.18.1</li> <li>PowerToy Utility: Fancy Zones</li> <li>Running PowerToys as Admin: Yes</li> <li>Windows build number: [run "winver"] 19041.450</li> </ul> <h2 dir="auto"><g-emoji class="g-emoji" alias="memo" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji> Provide detailed reproduction steps (if any)</h2> <ol dir="auto"> <li>Open Fancy Zones &gt; Custom Themes</li> <li>Add enough custom themes that they no longer fit on your screen</li> <li>See no Scroll option and delete themes so you can get to the Apply button</li> </ol> <h3 dir="auto">✔️ Expected result</h3> <p dir="auto"><em>What is the expected result of the above steps?</em><br> Ability to scroll down to Apply</p> <h3 dir="auto"><g-emoji class="g-emoji" alias="x" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/274c.png">❌</g-emoji> Actual result</h3> <p dir="auto"><em>What is the actual result of the above steps?</em><br> No way to see Apply without deleting layouts. Apply goes off screen.</p> <ul dir="auto"> <li>I move my computer between multiple monitor configurations and locations, and I have layouts for each so having to delete is not ideal.</li> </ul> <h2 dir="auto"><g-emoji class="g-emoji" alias="camera" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4f7.png">📷</g-emoji> Screenshots</h2> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/17508965/90152927-5dde5800-dd56-11ea-858f-c094084705f0.png"><img src="https://user-images.githubusercontent.com/17508965/90152927-5dde5800-dd56-11ea-858f-c094084705f0.png" alt="layout" style="max-width: 100%;"></a></p> <p dir="auto"><em>Are there any useful screenshots? WinKey+Shift+S and then just paste them directly into the form</em></p>
<p dir="auto">PowerToys notified me about an available auto-update from 0.18 to 0.18.1, but I accidentally dismissed this notification. I tried to find a "start the update"-button in the settings, but I couldn't find it. A restart of PowerToys also didn't trigger a new notification for the in-app-update. The only option to update seems to be to follow the check-update-link in the settings and to manually download the new version.</p>
0
<p dir="auto">I found that the v0.19.0-beta.1 version stopped updating after it was released.</p>
<p dir="auto">Is the project dead? Are new maintainers sought?</p> <ul dir="auto"> <li>97 open pull requests</li> <li>411 open issues</li> </ul>
1
<h1 dir="auto">Checklist</h1> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> This has already been asked to the <a href="https://groups.google.com/forum/#!forum/celery-users" rel="nofollow">discussion group</a> first.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the relevant section in the<br> <a href="http://docs.celeryproject.org/en/latest/contributing.html#other-bugs" rel="nofollow">contribution guide</a><br> on reporting bugs.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/issues?q=is%3Aissue+label%3A%22Issue+Type%3A+Bug+Report%22+-label%3A%22Category%3A+Documentation%22">issues list</a><br> for similar or identical bug reports.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/pulls?q=is%3Apr+label%3A%22PR+Type%3A+Bugfix%22+-label%3A%22Category%3A+Documentation%22">pull requests list</a><br> for existing proposed fixes.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/celery/celery/commits/master">commit log</a><br> to find out if the bug was already fixed in the master branch.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all related issues and possible duplicate issues<br> in this issue (If there are none, check this box anyway).</li> </ul> <h2 dir="auto">Mandatory Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the output of <code class="notranslate">celery -A proj report</code> in the issue.<br> (if you are not able to do this, then at least specify the Celery<br> version affected).</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have verified that the issue exists against the <code class="notranslate">master</code> branch of Celery.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included the contents of <code class="notranslate">pip freeze</code> in the issue.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have included all the versions of all the external dependencies required<br> to reproduce this bug.</li> </ul> <h2 dir="auto">Optional Debugging Information</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one Python version<br> and/or implementation.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one message broker and/or<br> result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one version of the message<br> broker and/or result backend.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one operating system.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue on more than one workers pool.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue with autoscaling, retries,<br> ETA/Countdown &amp; rate limits disabled.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have tried reproducing the issue after downgrading<br> and/or upgrading Celery and its dependencies.</li> </ul> <h2 dir="auto">Related Issues and Possible Duplicates</h2> <h4 dir="auto">Related Issues</h4> <ul dir="auto"> <li>None</li> </ul> <h4 dir="auto">Possible Duplicates</h4> <ul dir="auto"> <li>None</li> </ul> <h2 dir="auto">Environment &amp; Settings</h2> <p dir="auto"><strong>Celery version</strong>: celery==4.4.2</p> <details> <summary><b><code class="notranslate">celery report</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[2020-05-31 23:28:34,434: INFO/MainProcess] Connected to amqp://remote_worker:**@127.0.0.1:5672// [2020-05-31 23:28:34,453: INFO/MainProcess] mingle: searching for neighbors [2020-05-31 23:28:35,487: INFO/MainProcess] mingle: all alone [2020-05-31 23:28:35,528: WARNING/MainProcess] /home/ubuntu/.local/lib/python3.7/site-packages/celery/fixups/django.py:203: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments! leak, never use this setting in production environments!''') [2020-05-31 23:28:35,529: INFO/MainProcess] celery@testroom ready. [2020-05-31 23:28:47,351: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] [2020-05-31 23:28:47,689: WARNING/ForkPoolWorker-1] started [2020-05-31 23:28:47,690: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:28:47,690: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:28:47,721: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:28:57.692348+00:00] [2020-05-31 23:28:47,722: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:28:57.716321+00:00] [2020-05-31 23:28:47,777: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10) [2020-05-31 23:28:57,999: WARNING/ForkPoolWorker-1] started [2020-05-31 23:28:57,999: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:28:58,000: WARNING/ForkPoolWorker-1] ended [2020-05-31 23:28:58,000: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:28:58,062: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.34440315900428686s: None [2020-05-31 23:28:58,301: WARNING/ForkPoolWorker-1] started [2020-05-31 23:28:58,302: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:28:58,302: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:28:58,304: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:08.303091+00:00] [2020-05-31 23:28:58,307: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:08.306141+00:00] [2020-05-31 23:28:58,368: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10) [2020-05-31 23:29:08,572: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:08,572: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:08,573: WARNING/ForkPoolWorker-1] ended [2020-05-31 23:29:08,573: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:29:08,633: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.3256059319974156s: None [2020-05-31 23:29:08,872: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:08,872: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:08,873: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:29:08,875: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:18.873799+00:00] [2020-05-31 23:29:08,878: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:29:08,880: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:18.877550+00:00] [2020-05-31 23:29:08,940: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10) [2020-05-31 23:29:19,144: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:19,144: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:19,145: WARNING/ForkPoolWorker-1] ended [2020-05-31 23:29:19,145: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:29:19,205: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.326258520995907s: None [2020-05-31 23:29:19,444: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:19,444: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:19,445: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:29:19,505: ERROR/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] raised unexpected: Exception('i have filled now') Traceback (most recent call last): File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/trace.py&quot;, line 385, in trace_task R = retval = fun(*args, **kwargs) File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/trace.py&quot;, line 650, in __protected_call__ return self.run(*args, **kwargs) File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/base.py&quot;, line 500, in run raise task.retry(exc=exc, **retry_kwargs) File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/task.py&quot;, line 704, in retry raise_with_context(exc) File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/base.py&quot;, line 487, in run return task._orig_run(*args, **kwargs) File &quot;/var/www/django_projects/earthalytics-api/api_v3/tests.py&quot;, line 26, in execute self.retry(exc=Exception(&quot;i have filled now&quot;), args=[param_a, param_b], kwargs=kwargs) File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/task.py&quot;, line 704, in retry raise_with_context(exc) File &quot;/home/ubuntu/.local/lib/python3.7/site-packages/celery/utils/serialization.py&quot;, line 288, in raise_with_context _raise_with_context(exc, exc_info[1]) File &quot;&lt;string&gt;&quot;, line 1, in _raise_with_context Exception: i have filled now "><pre class="notranslate"><code class="notranslate">[2020-05-31 23:28:34,434: INFO/MainProcess] Connected to amqp://remote_worker:**@127.0.0.1:5672// [2020-05-31 23:28:34,453: INFO/MainProcess] mingle: searching for neighbors [2020-05-31 23:28:35,487: INFO/MainProcess] mingle: all alone [2020-05-31 23:28:35,528: WARNING/MainProcess] /home/ubuntu/.local/lib/python3.7/site-packages/celery/fixups/django.py:203: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments! leak, never use this setting in production environments!''') [2020-05-31 23:28:35,529: INFO/MainProcess] celery@testroom ready. [2020-05-31 23:28:47,351: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] [2020-05-31 23:28:47,689: WARNING/ForkPoolWorker-1] started [2020-05-31 23:28:47,690: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:28:47,690: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:28:47,721: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:28:57.692348+00:00] [2020-05-31 23:28:47,722: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:28:57.716321+00:00] [2020-05-31 23:28:47,777: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10) [2020-05-31 23:28:57,999: WARNING/ForkPoolWorker-1] started [2020-05-31 23:28:57,999: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:28:58,000: WARNING/ForkPoolWorker-1] ended [2020-05-31 23:28:58,000: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:28:58,062: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.34440315900428686s: None [2020-05-31 23:28:58,301: WARNING/ForkPoolWorker-1] started [2020-05-31 23:28:58,302: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:28:58,302: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:28:58,304: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:08.303091+00:00] [2020-05-31 23:28:58,307: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:08.306141+00:00] [2020-05-31 23:28:58,368: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10) [2020-05-31 23:29:08,572: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:08,572: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:08,573: WARNING/ForkPoolWorker-1] ended [2020-05-31 23:29:08,573: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:29:08,633: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.3256059319974156s: None [2020-05-31 23:29:08,872: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:08,872: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:08,873: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:29:08,875: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:18.873799+00:00] [2020-05-31 23:29:08,878: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:29:08,880: INFO/MainProcess] Received task: api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] ETA:[2020-05-31 23:29:18.877550+00:00] [2020-05-31 23:29:08,940: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] retry: Retry in 10s: Retry(Retry(...), Exception('i have filled now'), 10) [2020-05-31 23:29:19,144: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:19,144: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:19,145: WARNING/ForkPoolWorker-1] ended [2020-05-31 23:29:19,145: WARNING/ForkPoolWorker-1] BYEEEEE [2020-05-31 23:29:19,205: INFO/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] succeeded in 0.326258520995907s: None [2020-05-31 23:29:19,444: WARNING/ForkPoolWorker-1] started [2020-05-31 23:29:19,444: WARNING/ForkPoolWorker-1] HELLOOOOO [2020-05-31 23:29:19,445: WARNING/ForkPoolWorker-1] retry [2020-05-31 23:29:19,505: ERROR/ForkPoolWorker-1] Task api_v3.tests.execute[e97d93b5-b0e5-4b87-96ab-1aab66119906] raised unexpected: Exception('i have filled now') Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task R = retval = fun(*args, **kwargs) File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/trace.py", line 650, in __protected_call__ return self.run(*args, **kwargs) File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/base.py", line 500, in run raise task.retry(exc=exc, **retry_kwargs) File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/task.py", line 704, in retry raise_with_context(exc) File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/base.py", line 487, in run return task._orig_run(*args, **kwargs) File "/var/www/django_projects/earthalytics-api/api_v3/tests.py", line 26, in execute self.retry(exc=Exception("i have filled now"), args=[param_a, param_b], kwargs=kwargs) File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/app/task.py", line 704, in retry raise_with_context(exc) File "/home/ubuntu/.local/lib/python3.7/site-packages/celery/utils/serialization.py", line 288, in raise_with_context _raise_with_context(exc, exc_info[1]) File "&lt;string&gt;", line 1, in _raise_with_context Exception: i have filled now </code></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Steps to Reproduce</h1> <p dir="auto">Make a class with a destructor.<br> Make a celery task.<br> Instantiate the class in the celery task.<br> Make the celery task raise an Exception.<br> See how destructor dosn't get called.(Gets called if task ends in success)</p> <h2 dir="auto">Required Dependencies</h2> <ul dir="auto"> <li><strong>Minimal Python Version</strong>: N/A or Unknown</li> <li><strong>Minimal Celery Version</strong>: N/A or Unknown</li> <li><strong>Minimal Kombu Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Version</strong>: N/A or Unknown</li> <li><strong>Minimal OS and/or Kernel Version</strong>: N/A or Unknown</li> <li><strong>Minimal Broker Client Version</strong>: N/A or Unknown</li> <li><strong>Minimal Result Backend Client Version</strong>: N/A or Unknown</li> </ul> <h3 dir="auto">Python Packages</h3> <details> <summary><b><code class="notranslate">pip freeze</code> Output:</b></summary> <p dir="auto"> </p><div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div> <p dir="auto"></p> </details> <h3 dir="auto">Other Dependencies</h3> <details> <p dir="auto"> N/A </p> </details> <h2 dir="auto">Minimally Reproducible Test Case</h2> <details> <p dir="auto"> </p><div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class WelcomeClass(): def __init__(self): print(&quot;HELLOOOOO&quot;) def __del__(self): print(&quot;BYEEEEE&quot;) @app_cluster.task(bind=True, autoretry_for=(Exception,), max_retries=3, default_retry_delay=10) def execute(self, param_a, param_b=None, **kwargs): print(&quot;started&quot;) jb = WelcomeClass() if param_b is None: param_b = &quot;filled&quot; print(&quot;retry&quot;) self.retry(exc=Exception(&quot;i have filled now&quot;), args=[param_a, param_b], kwargs=kwargs) print(&quot;ended&quot;) def test_celery(self): sig = execute.si(&quot;something&quot;) t = sig.delay() t = 0"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">WelcomeClass</span>(): <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>): <span class="pl-en">print</span>(<span class="pl-s">"HELLOOOOO"</span>) <span class="pl-k">def</span> <span class="pl-en">__del__</span>(<span class="pl-s1">self</span>): <span class="pl-en">print</span>(<span class="pl-s">"BYEEEEE"</span>) <span class="pl-en">@<span class="pl-s1">app_cluster</span>.<span class="pl-en">task</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">autoretry_for</span><span class="pl-c1">=</span>(<span class="pl-v">Exception</span>,), <span class="pl-s1">max_retries</span><span class="pl-c1">=</span><span class="pl-c1">3</span>,</span> <span class="pl-en"> <span class="pl-s1">default_retry_delay</span><span class="pl-c1">=</span><span class="pl-c1">10</span>)</span> <span class="pl-k">def</span> <span class="pl-en">execute</span>(<span class="pl-s1">self</span>, <span class="pl-s1">param_a</span>, <span class="pl-s1">param_b</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-c1">**</span><span class="pl-s1">kwargs</span>): <span class="pl-en">print</span>(<span class="pl-s">"started"</span>) <span class="pl-s1">jb</span> <span class="pl-c1">=</span> <span class="pl-v">WelcomeClass</span>() <span class="pl-k">if</span> <span class="pl-s1">param_b</span> <span class="pl-c1">is</span> <span class="pl-c1">None</span>: <span class="pl-s1">param_b</span> <span class="pl-c1">=</span> <span class="pl-s">"filled"</span> <span class="pl-en">print</span>(<span class="pl-s">"retry"</span>) <span class="pl-s1">self</span>.<span class="pl-en">retry</span>(<span class="pl-s1">exc</span><span class="pl-c1">=</span><span class="pl-v">Exception</span>(<span class="pl-s">"i have filled now"</span>), <span class="pl-s1">args</span><span class="pl-c1">=</span>[<span class="pl-s1">param_a</span>, <span class="pl-s1">param_b</span>], <span class="pl-s1">kwargs</span><span class="pl-c1">=</span><span class="pl-s1">kwargs</span>) <span class="pl-en">print</span>(<span class="pl-s">"ended"</span>) <span class="pl-k">def</span> <span class="pl-en">test_celery</span>(<span class="pl-s1">self</span>): <span class="pl-s1">sig</span> <span class="pl-c1">=</span> <span class="pl-s1">execute</span>.<span class="pl-en">si</span>(<span class="pl-s">"something"</span>) <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">sig</span>.<span class="pl-en">delay</span>() <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span></pre></div> <p dir="auto"></p> </details> <h1 dir="auto">Expected Behavior</h1> <p dir="auto">I expect the destructor of a class begin called everytime a celery task succeed/fail/raise exception etc</p> <h1 dir="auto">Actual Behavior</h1> Destrucutor gets called only when task succeed.
<h2 dir="auto">Summary</h2> <p dir="auto">In a Celery/RabbitMQ/Heroku setup with many tasks using countdown/eta and retry, I'm experiencing workers suddenly not processing tasks anymore. They don't raise an exception and the main Celery process does not terminate.</p> <p dir="auto">I will outline in some detail what I'm seeing and present a single case with a log section showing a worker process that is processing tasks, then it gets restarted (24h Heroku dyno cycling), then it processes one more task which ends in a retry, and then it seemingly 'falls asleep' (it ignores all the tasks piling up in the task queue, and even when the currently fetched task is up for retry, it doesn't process it).</p> <p dir="auto">What possible reasons could you think of, which destabilize a Celery worker that has to process a lot of countdown/eta/retry? Anything with <code class="notranslate">prefetch_count</code> maybe? Is there anything that could clog up the local pool in a worker to the point that it no longer fetches new tasks or processes local ones?</p> <h2 dir="auto">Environment</h2> <p dir="auto">Python: 2.7.12<br> Versions: celery 3.1.24, kombu 3.0.37, billiard 3.3.0.23, amqp 1.4.9<br> Broker: RabbitMQ (professionally hosted with CloudAMQP, standard configuration)<br> Platform: Heroku (Linux)</p> <h2 dir="auto">Configuration</h2> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CELERYD_PREFETCH_MULTIPLIER = 1 # broker configuration as advised by https://www.cloudamqp.com/docs/celery.html BROKER_URL = os.environ.get('CLOUDAMQP_URL') BROKER_USE_SSL = True BROKER_POOL_LIMIT = 1 # important for small AMQP plans! see https://devcenter.heroku.com/articles/cloudamqp#celery BROKER_HEARTBEAT = None # we're using TCP keep-alive instead BROKER_CONNECTION_TIMEOUT = 30 # may require a long timeout due to Linux DNS timeouts etc CELERY_EVENT_QUEUE_EXPIRES = 60 # expire temporary event queues after 60 seconds CELERY_TRACK_STARTED = True # The task will report its status as &quot;started&quot; when the task is executed by a worker. Can be useful for when there are long running tasks and there is a need to report which task is currently running. - http://docs.celeryproject.org/en/latest/configuration.html#celery-track-started"><pre class="notranslate"><code class="notranslate">CELERYD_PREFETCH_MULTIPLIER = 1 # broker configuration as advised by https://www.cloudamqp.com/docs/celery.html BROKER_URL = os.environ.get('CLOUDAMQP_URL') BROKER_USE_SSL = True BROKER_POOL_LIMIT = 1 # important for small AMQP plans! see https://devcenter.heroku.com/articles/cloudamqp#celery BROKER_HEARTBEAT = None # we're using TCP keep-alive instead BROKER_CONNECTION_TIMEOUT = 30 # may require a long timeout due to Linux DNS timeouts etc CELERY_EVENT_QUEUE_EXPIRES = 60 # expire temporary event queues after 60 seconds CELERY_TRACK_STARTED = True # The task will report its status as "started" when the task is executed by a worker. Can be useful for when there are long running tasks and there is a need to report which task is currently running. - http://docs.celeryproject.org/en/latest/configuration.html#celery-track-started </code></pre></div> <p dir="auto">A single worker dyno is launched with the following command line:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="worker: celery worker --app=myapp --queues=priority,default --concurrency=3 --loglevel=DEBUG -Ofair --without-heartbeat --without-gossip --without-mingle"><pre class="notranslate"><code class="notranslate">worker: celery worker --app=myapp --queues=priority,default --concurrency=3 --loglevel=DEBUG -Ofair --without-heartbeat --without-gossip --without-mingle </code></pre></div> <p dir="auto">There's a second dyno type, with a similar configuration, but which is only working the <code class="notranslate">priority</code> queue and also has <code class="notranslate">--beat</code> set. It was not affected in the case shown here and kept processing the tasks from the <code class="notranslate">priority</code> queue when the <code class="notranslate">worker</code> type had frozen. (Tasks on the priority queue never have a <code class="notranslate">countdown</code> set and only rarely use retry.)</p> <h2 dir="auto">Issue</h2> <p dir="auto">The worker is running with the preforked pool and a <code class="notranslate">concurrency</code> of 3. It's receiving a lot of tasks with an ETA of 15mins. Quite often these tasks need to be retried (always with a 30min delay).</p> <p dir="auto">Every once in a while, at seemingly arbitrary times of the day, the worker will process one last task and then stop. The last task often ends in a retry, but not always (maybe 80% of the time).<br> This occurs sometimes multiple times a day and sometimes it doesn't for days. Sometimes it occurs hours later and sometimes right after the worker has started. (Heroku restarts them every 24h by force, so I never have a worker running longer than that.)</p> <p dir="auto">When it does occur, the worker stops processing any tasks. It doesn't receive any new tasks from the broker, nor does it proceed with tasks in the local pool that have been pushed back by way of retry.</p> <h2 dir="auto">Example</h2> <p dir="auto">The following log shows one case of this. Here's the order of events to be seen:</p> <ol dir="auto"> <li>14:21:58: The worker is working fine. The <code class="notranslate">prefetch_count</code> is 65 (so it's my understanding that 62 tasks are waiting to be retried).</li> <li>14:21:59: Task <code class="notranslate">a2a5bc98</code> is fetched from RabbitMQ, processed and completed (no retry).</li> <li>14:21:59: Heroku decides that after 24h, it wants to restart (cycle) the dyno, so it performs a shutdown of Celery (note that this still affected by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="109864323" data-permission-text="Title is private" data-url="https://github.com/celery/celery/issues/2839" data-hovercard-type="issue" data-hovercard-url="/celery/celery/issues/2839/hovercard" href="https://github.com/celery/celery/issues/2839">#2839</a>, so active tasks are not being shut down cleanly, however no task seems to have been in process in this case).</li> <li>14:22:11: Celery starts up again in a new dyno with a new process.</li> <li>14:22:11: After the restart, the <code class="notranslate">prefetch_count</code> goes back to 3 (the configured concurrency).</li> <li>14:22:11: The worker receives a single task (why not at least three?), <code class="notranslate">09ffc23f</code>, which has an ETA, and increases the <code class="notranslate">prefetch_count</code> to 4.</li> </ol> <p dir="auto">Nothing happens for two minutes! (I didn't cut anything from the log of this dyno here.)</p> <ol start="7" dir="auto"> <li>14:24:25: Then the <code class="notranslate">prefetch_count</code> is set back to 3, and the task is accepted. It is executed to the end, and ends in a retry.</li> </ol> <p dir="auto">From here on, the worker doesn't do anything anymore. Not even at 14:54:26, when it should have retried task <code class="notranslate">09ffc23f</code> from the local pool.</p> <p dir="auto">It's not possible to inspect the dyno on Heroku, but I know the main worker process hasn't crashed (I don't know about the preforked subprocesses) for two reasons:<br> a) If the main process terminates, Heroku detects that and restarts the dyno. But it doesn't.<br> b) When I eventually restart the dyno manually, Heroku sends a signal to the process, and I see the log lines on <code class="notranslate">celery.bootsteps</code> around <code class="notranslate">Closing Hub</code>, <code class="notranslate">Closing consumer channel</code> and so on.</p> <h2 dir="auto">Logs</h2> <p dir="auto">And finally, here's the log to the case described above:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Jan 20 14:21:58 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;65 Jan 20 14:21:59 myapp app/worker.1: INFO [-/-/-/celery.worker.strategy] Received task: myapp.retrieve[a2a5bc98-906a-4c6a-ab30-762a7c738143] Jan 20 14:21:59 myapp app/worker.1: DEBUG [-/-/-/celery.pool] TaskPool: Apply &lt;function _fast_trace_task at 0x7f74d12b5398&gt; (args:(u'myapp.retrieve', 'a2a5bc98-906a-4c6a-ab30-762a7c738143', [], {u'account_id': 5466}, {'retries': 0, 'id': 'a2a5bc98-906a-4c6a-ab30-762a7c738143', u'reply_to': u'9e8056dd-a933-3398-98bf-e6af7669487d', 'utc': True, 'expires': None, u'correlation_id': u'a2a5bc98-906a-4c6a-ab30-762a7c738143', u'headers': {}, 'taskset': None, u'group': None, u'hostname': 'celery@1b7e0939-0c49-46c4-b9cd-33adc9f30fcd', u'delivery_info': {u'exchange': u'default', u'routing_key': u'priority', u'priority': None, u'redelivered': False}, 'kwargs': {u'account_id': 5466}, 'task': u'myapp.retrieve', u'is_eager': False, 'errbacks': None, 'eta': None, 'args': [], 'callbacks': None, 'chord': None, 'timelimit': (None, None)}) kwargs:{}) Jan 20 14:21:59 myapp app/worker.1: DEBUG [-/-/-/celery.worker.job] Task accepted: myapp.retrieve[a2a5bc98-906a-4c6a-ab30-762a7c738143] pid:11 Jan 20 14:21:59 myapp heroku/worker.1: Cycling Jan 20 14:21:59 myapp heroku/worker.1: State changed from up to starting Jan 20 14:21:59 myapp app/worker.1: INFO [myapp.retrieve/a2a5bc98/acc5466/myapp.tasks] Complete Jan 20 14:22:00 myapp app/worker.1: INFO [-/-/-/celery.worker.job] Task myapp.retrieve[a2a5bc98-906a-4c6a-ab30-762a7c738143] succeeded in 0.820070138987s: None Jan 20 14:22:00 myapp heroku/worker.1: Stopping all processes with SIGTERM Jan 20 14:22:00 myapp app/worker.1: worker: Warm shutdown (MainProcess) Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Closing Hub... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Closing Pool... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Closing Consumer... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Stopping Consumer... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Connection... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Events... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Tasks... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Control... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing event loop... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping event loop... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Control... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/amqp] Closed channel #2 Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Tasks... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.worker.consumer] Canceling task consumer... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Events... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Connection... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Stopping Pool... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Stopping Hub... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Control... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Tasks... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.worker.consumer] Canceling task consumer... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.worker.consumer] Closing consumer channel... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Events... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/amqp] Closed channel #1 Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Connection... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/amqp] Closed channel #1 Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.concurrency.asynpool] removing tasks from inqueue until task handler finished Jan 20 14:22:02 myapp heroku/worker.1: Process exited with status 0 Jan 20 14:22:08 myapp heroku/worker.1: Starting process with command `celery worker --app=myapp --queues=priority,default --concurrency=3 --loglevel=DEBUG -Ofair --without-heartbeat --without-gossip --without-mingle` Jan 20 14:22:08 myapp heroku/worker.1: State changed from starting to up Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Preparing bootsteps. Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Building graph... Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: New boot order: {StateDB, Timer, Hub, Queues (intra), Pool, Autoreloader, Beat, Autoscaler, Consumer} Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Preparing bootsteps. Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Building graph... Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: New boot order: {Connection, Events, Mingle, Tasks, Control, Heart, Agent, Gossip, event loop} Jan 20 14:22:11 myapp app/worker.1: -------------- celery@49b5f034-8438-4b82-8fd8-1cc7c8180f03 v3.1.24 (Cipater) Jan 20 14:22:11 myapp app/worker.1: ---- **** ----- Jan 20 14:22:11 myapp app/worker.1: --- * *** * -- Linux-3.13.0-105-generic-x86_64-with-debian-jessie-sid Jan 20 14:22:11 myapp app/worker.1: -- * - **** --- Jan 20 14:22:11 myapp app/worker.1: - ** ---------- [config] Jan 20 14:22:11 myapp app/worker.1: - ** ---------- .&gt; app: myapp:0x7f20a3c28d10 Jan 20 14:22:11 myapp app/worker.1: - ** ---------- .&gt; transport: amqp://myapp:**@moose.rmq.cloudamqp.com:5671/myapp Jan 20 14:22:11 myapp app/worker.1: - ** ---------- .&gt; results: Jan 20 14:22:11 myapp app/worker.1: - *** --- * --- .&gt; concurrency: 3 (prefork) Jan 20 14:22:11 myapp app/worker.1: -- ******* ---- Jan 20 14:22:11 myapp app/worker.1: --- ***** ----- [queues] Jan 20 14:22:11 myapp app/worker.1: -------------- .&gt; default exchange=default(direct) key=default Jan 20 14:22:11 myapp app/worker.1: .&gt; priority exchange=default(direct) key=priority Jan 20 14:22:11 myapp app/worker.1: [tasks] Jan 20 14:22:11 myapp app/worker.1: . celery.backend_cleanup Jan 20 14:22:11 myapp app/worker.1: . celery.chain Jan 20 14:22:11 myapp app/worker.1: . celery.chord Jan 20 14:22:11 myapp app/worker.1: . celery.chord_unlock Jan 20 14:22:11 myapp app/worker.1: . celery.chunks Jan 20 14:22:11 myapp app/worker.1: . celery.group Jan 20 14:22:11 myapp app/worker.1: . celery.map Jan 20 14:22:11 myapp app/worker.1: . celery.starmap [...] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Starting Hub Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Starting Pool Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Starting Consumer Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Connection Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Start from server, version: 0.9, properties: {u'version': u'3.5.6', u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'platform': u'Erlang/OTP', u'copyright': u'Copyright (C) 2007-2015 Pivotal Software, Inc.', u'product': u'RabbitMQ', u'cluster_name': u'moose', u'capabilities': {u'authentication_failure_close': True, u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'consumer_priorities': True, u'per_consumer_qos': True, u'connection.blocked': True, u'basic.nack': True, u'publisher_confirms': True}}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US'] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Open OK! Jan 20 14:22:11 myapp app/worker.1: INFO [-/-/-/celery.worker.consumer] Connected to amqp://myapp:**@moose.rmq.cloudamqp.com:5671/myapp Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Events Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Start from server, version: 0.9, properties: {u'version': u'3.5.6', u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'platform': u'Erlang/OTP', u'copyright': u'Copyright (C) 2007-2015 Pivotal Software, Inc.', u'product': u'RabbitMQ', u'cluster_name': u'moose', u'capabilities': {u'authentication_failure_close': True, u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'consumer_priorities': True, u'per_consumer_qos': True, u'connection.blocked': True, u'basic.nack': True, u'publisher_confirms': True}}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US'] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Open OK! Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] using channel_id: 1 Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Channel open Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Tasks Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] using channel_id: 1 Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Channel open Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Control Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] using channel_id: 2 Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Channel open Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting event loop Jan 20 14:22:11 myapp app/worker.1: INFO [-/-/-/celery.redirected] celery@49b5f034-8438-4b82-8fd8-1cc7c8180f03 ready. Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Hub.register Pool... Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;3 Jan 20 14:22:11 myapp app/worker.1: INFO [-/-/-/celery.worker.strategy] Received task: myapp.finalize[09ffc23f-759a-4147-ab3a-ef5ad669afe1] eta:[2017-01-20 14:24:25.142725+00:00] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;4 Jan 20 14:24:25 myapp app/worker.1: DEBUG [-/-/-/celery.pool] TaskPool: Apply &lt;function _fast_trace_task at 0x7f20a0707398&gt; (args:(u'myapp.finalize', '09ffc23f-759a-4147-ab3a-ef5ad669afe1', [], {u'account_id': 4426, u'reaction_id': 1494970}, {'taskset': None, 'retries': 22, 'task': u'myapp.finalize', 'timelimit': (None, None), 'utc': True, u'hostname': 'celery@49b5f034-8438-4b82-8fd8-1cc7c8180f03', 'id': '09ffc23f-759a-4147-ab3a-ef5ad669afe1', 'args': [], u'reply_to': u'dd5e604d-f8d3-3b4e-9a24-6011f659934a', 'kwargs': {u'account_id': 4426, u'reaction_id': 1494970}, u'group': None, 'eta': '2017-01-20T14:24:25.142725+00:00', 'callbacks': None, 'errbacks': None, 'chord': None, u'headers': {}, 'expires': None, u'delivery_info': {u'exchange': u'default', u'routing_key': u'default', u'redelivered': True, u'priority': 0}, u'is_eager': False, u'correlation_id': u'09ffc23f-759a-4147-ab3a-ef5ad669afe1'}) kwargs:{}) Jan 20 14:24:26 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;3 Jan 20 14:24:26 myapp app/worker.1: DEBUG [-/-/-/celery.worker.job] Task accepted: myapp.finalize[09ffc23f-759a-4147-ab3a-ef5ad669afe1] pid:11 Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/-/integration.operational.sentry_client.CustomSentryClient] Configuring Raven for host: &lt;raven.conf.remote.RemoteConfig object at 0x7f20998a5090&gt; Jan 20 14:24:26 myapp app/worker.1: INFO [myapp.finalize/09ffc23f/acc4426/myapp.tasks] Rescheduling task Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc4426/amqp] Start from server, version: 0.9, properties: {u'version': u'3.5.6', u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'platform': u'Erlang/OTP', u'copyright': u'Copyright (C) 2007-2015 Pivotal Software, Inc.', u'product': u'RabbitMQ', u'cluster_name': u'moose', u'capabilities': {u'authentication_failure_close': True, u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'consumer_priorities': True, u'per_consumer_qos': True, u'connection.blocked': True, u'basic.nack': True, u'publisher_confirms': True}}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US'] Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc0541/amqp] Open OK! Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc0541/amqp] using channel_id: 1 Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc0541/amqp] Channel open Jan 20 14:24:26 myapp app/worker.1: INFO [-/-/-/celery.worker.job] Task myapp.finalize[09ffc23f-759a-4147-ab3a-ef5ad669afe1] retry: Retry in 1800s "><pre class="notranslate"><code class="notranslate">Jan 20 14:21:58 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;65 Jan 20 14:21:59 myapp app/worker.1: INFO [-/-/-/celery.worker.strategy] Received task: myapp.retrieve[a2a5bc98-906a-4c6a-ab30-762a7c738143] Jan 20 14:21:59 myapp app/worker.1: DEBUG [-/-/-/celery.pool] TaskPool: Apply &lt;function _fast_trace_task at 0x7f74d12b5398&gt; (args:(u'myapp.retrieve', 'a2a5bc98-906a-4c6a-ab30-762a7c738143', [], {u'account_id': 5466}, {'retries': 0, 'id': 'a2a5bc98-906a-4c6a-ab30-762a7c738143', u'reply_to': u'9e8056dd-a933-3398-98bf-e6af7669487d', 'utc': True, 'expires': None, u'correlation_id': u'a2a5bc98-906a-4c6a-ab30-762a7c738143', u'headers': {}, 'taskset': None, u'group': None, u'hostname': 'celery@1b7e0939-0c49-46c4-b9cd-33adc9f30fcd', u'delivery_info': {u'exchange': u'default', u'routing_key': u'priority', u'priority': None, u'redelivered': False}, 'kwargs': {u'account_id': 5466}, 'task': u'myapp.retrieve', u'is_eager': False, 'errbacks': None, 'eta': None, 'args': [], 'callbacks': None, 'chord': None, 'timelimit': (None, None)}) kwargs:{}) Jan 20 14:21:59 myapp app/worker.1: DEBUG [-/-/-/celery.worker.job] Task accepted: myapp.retrieve[a2a5bc98-906a-4c6a-ab30-762a7c738143] pid:11 Jan 20 14:21:59 myapp heroku/worker.1: Cycling Jan 20 14:21:59 myapp heroku/worker.1: State changed from up to starting Jan 20 14:21:59 myapp app/worker.1: INFO [myapp.retrieve/a2a5bc98/acc5466/myapp.tasks] Complete Jan 20 14:22:00 myapp app/worker.1: INFO [-/-/-/celery.worker.job] Task myapp.retrieve[a2a5bc98-906a-4c6a-ab30-762a7c738143] succeeded in 0.820070138987s: None Jan 20 14:22:00 myapp heroku/worker.1: Stopping all processes with SIGTERM Jan 20 14:22:00 myapp app/worker.1: worker: Warm shutdown (MainProcess) Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Closing Hub... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Closing Pool... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Closing Consumer... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Stopping Consumer... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Connection... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Events... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Tasks... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing Control... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Closing event loop... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping event loop... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Control... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/amqp] Closed channel #2 Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Tasks... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.worker.consumer] Canceling task consumer... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Events... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Stopping Connection... Jan 20 14:22:00 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Stopping Pool... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Stopping Hub... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Control... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Tasks... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.worker.consumer] Canceling task consumer... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.worker.consumer] Closing consumer channel... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Events... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/amqp] Closed channel #1 Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Shutdown Connection... Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/amqp] Closed channel #1 Jan 20 14:22:01 myapp app/worker.1: DEBUG [-/-/-/celery.concurrency.asynpool] removing tasks from inqueue until task handler finished Jan 20 14:22:02 myapp heroku/worker.1: Process exited with status 0 Jan 20 14:22:08 myapp heroku/worker.1: Starting process with command `celery worker --app=myapp --queues=priority,default --concurrency=3 --loglevel=DEBUG -Ofair --without-heartbeat --without-gossip --without-mingle` Jan 20 14:22:08 myapp heroku/worker.1: State changed from starting to up Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Preparing bootsteps. Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Building graph... Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: New boot order: {StateDB, Timer, Hub, Queues (intra), Pool, Autoreloader, Beat, Autoscaler, Consumer} Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Preparing bootsteps. Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Building graph... Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: New boot order: {Connection, Events, Mingle, Tasks, Control, Heart, Agent, Gossip, event loop} Jan 20 14:22:11 myapp app/worker.1: -------------- celery@49b5f034-8438-4b82-8fd8-1cc7c8180f03 v3.1.24 (Cipater) Jan 20 14:22:11 myapp app/worker.1: ---- **** ----- Jan 20 14:22:11 myapp app/worker.1: --- * *** * -- Linux-3.13.0-105-generic-x86_64-with-debian-jessie-sid Jan 20 14:22:11 myapp app/worker.1: -- * - **** --- Jan 20 14:22:11 myapp app/worker.1: - ** ---------- [config] Jan 20 14:22:11 myapp app/worker.1: - ** ---------- .&gt; app: myapp:0x7f20a3c28d10 Jan 20 14:22:11 myapp app/worker.1: - ** ---------- .&gt; transport: amqp://myapp:**@moose.rmq.cloudamqp.com:5671/myapp Jan 20 14:22:11 myapp app/worker.1: - ** ---------- .&gt; results: Jan 20 14:22:11 myapp app/worker.1: - *** --- * --- .&gt; concurrency: 3 (prefork) Jan 20 14:22:11 myapp app/worker.1: -- ******* ---- Jan 20 14:22:11 myapp app/worker.1: --- ***** ----- [queues] Jan 20 14:22:11 myapp app/worker.1: -------------- .&gt; default exchange=default(direct) key=default Jan 20 14:22:11 myapp app/worker.1: .&gt; priority exchange=default(direct) key=priority Jan 20 14:22:11 myapp app/worker.1: [tasks] Jan 20 14:22:11 myapp app/worker.1: . celery.backend_cleanup Jan 20 14:22:11 myapp app/worker.1: . celery.chain Jan 20 14:22:11 myapp app/worker.1: . celery.chord Jan 20 14:22:11 myapp app/worker.1: . celery.chord_unlock Jan 20 14:22:11 myapp app/worker.1: . celery.chunks Jan 20 14:22:11 myapp app/worker.1: . celery.group Jan 20 14:22:11 myapp app/worker.1: . celery.map Jan 20 14:22:11 myapp app/worker.1: . celery.starmap [...] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Starting Hub Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Starting Pool Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Starting Consumer Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Connection Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Start from server, version: 0.9, properties: {u'version': u'3.5.6', u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'platform': u'Erlang/OTP', u'copyright': u'Copyright (C) 2007-2015 Pivotal Software, Inc.', u'product': u'RabbitMQ', u'cluster_name': u'moose', u'capabilities': {u'authentication_failure_close': True, u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'consumer_priorities': True, u'per_consumer_qos': True, u'connection.blocked': True, u'basic.nack': True, u'publisher_confirms': True}}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US'] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Open OK! Jan 20 14:22:11 myapp app/worker.1: INFO [-/-/-/celery.worker.consumer] Connected to amqp://myapp:**@moose.rmq.cloudamqp.com:5671/myapp Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Events Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Start from server, version: 0.9, properties: {u'version': u'3.5.6', u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'platform': u'Erlang/OTP', u'copyright': u'Copyright (C) 2007-2015 Pivotal Software, Inc.', u'product': u'RabbitMQ', u'cluster_name': u'moose', u'capabilities': {u'authentication_failure_close': True, u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'consumer_priorities': True, u'per_consumer_qos': True, u'connection.blocked': True, u'basic.nack': True, u'publisher_confirms': True}}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US'] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Open OK! Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] using channel_id: 1 Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Channel open Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Tasks Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] using channel_id: 1 Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Channel open Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting Control Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] using channel_id: 2 Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/amqp] Channel open Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] ^-- substep ok Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Consumer: Starting event loop Jan 20 14:22:11 myapp app/worker.1: INFO [-/-/-/celery.redirected] celery@49b5f034-8438-4b82-8fd8-1cc7c8180f03 ready. Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/celery.bootsteps] | Worker: Hub.register Pool... Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;3 Jan 20 14:22:11 myapp app/worker.1: INFO [-/-/-/celery.worker.strategy] Received task: myapp.finalize[09ffc23f-759a-4147-ab3a-ef5ad669afe1] eta:[2017-01-20 14:24:25.142725+00:00] Jan 20 14:22:11 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;4 Jan 20 14:24:25 myapp app/worker.1: DEBUG [-/-/-/celery.pool] TaskPool: Apply &lt;function _fast_trace_task at 0x7f20a0707398&gt; (args:(u'myapp.finalize', '09ffc23f-759a-4147-ab3a-ef5ad669afe1', [], {u'account_id': 4426, u'reaction_id': 1494970}, {'taskset': None, 'retries': 22, 'task': u'myapp.finalize', 'timelimit': (None, None), 'utc': True, u'hostname': 'celery@49b5f034-8438-4b82-8fd8-1cc7c8180f03', 'id': '09ffc23f-759a-4147-ab3a-ef5ad669afe1', 'args': [], u'reply_to': u'dd5e604d-f8d3-3b4e-9a24-6011f659934a', 'kwargs': {u'account_id': 4426, u'reaction_id': 1494970}, u'group': None, 'eta': '2017-01-20T14:24:25.142725+00:00', 'callbacks': None, 'errbacks': None, 'chord': None, u'headers': {}, 'expires': None, u'delivery_info': {u'exchange': u'default', u'routing_key': u'default', u'redelivered': True, u'priority': 0}, u'is_eager': False, u'correlation_id': u'09ffc23f-759a-4147-ab3a-ef5ad669afe1'}) kwargs:{}) Jan 20 14:24:26 myapp app/worker.1: DEBUG [-/-/-/kombu.common] basic.qos: prefetch_count-&gt;3 Jan 20 14:24:26 myapp app/worker.1: DEBUG [-/-/-/celery.worker.job] Task accepted: myapp.finalize[09ffc23f-759a-4147-ab3a-ef5ad669afe1] pid:11 Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/-/integration.operational.sentry_client.CustomSentryClient] Configuring Raven for host: &lt;raven.conf.remote.RemoteConfig object at 0x7f20998a5090&gt; Jan 20 14:24:26 myapp app/worker.1: INFO [myapp.finalize/09ffc23f/acc4426/myapp.tasks] Rescheduling task Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc4426/amqp] Start from server, version: 0.9, properties: {u'version': u'3.5.6', u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'platform': u'Erlang/OTP', u'copyright': u'Copyright (C) 2007-2015 Pivotal Software, Inc.', u'product': u'RabbitMQ', u'cluster_name': u'moose', u'capabilities': {u'authentication_failure_close': True, u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'consumer_priorities': True, u'per_consumer_qos': True, u'connection.blocked': True, u'basic.nack': True, u'publisher_confirms': True}}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US'] Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc0541/amqp] Open OK! Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc0541/amqp] using channel_id: 1 Jan 20 14:24:26 myapp app/worker.1: DEBUG [myapp.finalize/09ffc23f/acc0541/amqp] Channel open Jan 20 14:24:26 myapp app/worker.1: INFO [-/-/-/celery.worker.job] Task myapp.finalize[09ffc23f-759a-4147-ab3a-ef5ad669afe1] retry: Retry in 1800s </code></pre></div> <p dir="auto">After this, there was silence in this worker's logs for the next 60 minutes. Then I restarted it and it started processing tasks just fine for the next hour or two, until the same issue occured. Rinse and repeat.</p> <h2 dir="auto">Second case</h2> <p dir="auto">Here's another case, this time with RabbitMQ management graph:</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/159414/22160692/0765c51e-df47-11e6-8a15-13446e2f61c6.png"><img src="https://cloud.githubusercontent.com/assets/159414/22160692/0765c51e-df47-11e6-8a15-13446e2f61c6.png" alt="image" style="max-width: 100%;"></a></p> <p dir="auto">Worker was started at 19:13:23. It processed a couple of tasks (about one every 20s, which is unexpectedly few), the last one at 19:21:55, then went silent.</p>
0
<p dir="auto">Notice how <code class="notranslate">6</code> and <code class="notranslate">false</code> are not colored</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1926584/11899860/6047fba0-a5a2-11e5-8fcd-1de698b91526.png"><img src="https://cloud.githubusercontent.com/assets/1926584/11899860/6047fba0-a5a2-11e5-8fcd-1de698b91526.png" alt="screen shot 2015-12-18 at 16 13 52" style="max-width: 100%;"></a></p>
<ul dir="auto"> <li>Open nodeAppInsightsTelemtryAppender.ts#40</li> <li>Notice broken colouring of comments inside contructor arguments</li> </ul> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/1926584/13035008/ed1f36a4-d344-11e5-83df-caf715965c47.png"><img width="543" alt="screen shot 2016-02-14 at 18 00 03" src="https://cloud.githubusercontent.com/assets/1926584/13035008/ed1f36a4-d344-11e5-83df-caf715965c47.png" style="max-width: 100%;"></a></p> <p dir="auto">Other problematic languages with deep scope hierarchies:</p> <ul dir="auto"> <li>JSX tags</li> <li>Java</li> </ul>
1
<p dir="auto">I think it might be a good add to let the user use buttons as prepend/addons. There are a lot of uses for it (reseting a field, single-field submit button, show field options etc) and it wouldn't be that hard to integrate. It just needs a few CSS tweaks.</p> <p dir="auto">It's currently possible but the CSS result is rather messy : <a href="http://jsfiddle.net/9RwWJ/5/" rel="nofollow">http://jsfiddle.net/9RwWJ/5/</a></p>
<p dir="auto">Hi!! It would be nice to have a growl-like notification component within bootstrap :)</p> <p dir="auto">Here are the most important jquery scripts:<br> <a href="http://webtoolkit4.me/2009/08/13/jquery-growl-likenotification-systems/" rel="nofollow">http://webtoolkit4.me/2009/08/13/jquery-growl-likenotification-systems/</a></p> <p dir="auto">Personally I like jquery Purr <a href="http://kitchen.net-perspective.com/purr-example-4.html" rel="nofollow">http://kitchen.net-perspective.com/purr-example-4.html</a></p> <p dir="auto">What do you think about that?</p> <p dir="auto">Thanks for all!<br> Raúl</p>
0
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; x = np.ones(10) &gt;&gt;&gt; np.add(x,x[:1],x) array([ 2., 3., 3., 3., 3., 3., 3., 3., 3., 3.]) &gt;&gt;&gt; x = np.ones(10) &gt;&gt;&gt; np.add(x,x[4:5],x) array([ 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.])"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; x = np.ones(10) &gt;&gt;&gt; np.add(x,x[:1],x) array([ 2., 3., 3., 3., 3., 3., 3., 3., 3., 3.]) &gt;&gt;&gt; x = np.ones(10) &gt;&gt;&gt; np.add(x,x[4:5],x) array([ 2., 2., 2., 2., 2., 2., 2., 2., 2., 2.]) </code></pre></div> <p dir="auto">The first makes sense, but I expected the second to end with a string of 3's. Not totally sure if this is a bug or if aliased ufunc operands is documented as undefined behaviour somewhere.</p> <p dir="auto">The above was produced using the current master and ubuntu. On another windows machine with 1.10.4 I get even weirder:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.add(x,x[4:5],x) array([ 2., 2., 2., 2., 2., 2., 2., 2., 2., 3.])"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.add(x,x[4:5],x) array([ 2., 2., 2., 2., 2., 2., 2., 2., 2., 3.]) </code></pre></div>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1085" rel="nofollow">http://projects.scipy.org/numpy/ticket/1085</a> on 2009-04-15 by trac user tillmann, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/charris/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/charris">@charris</a>.</em></p> <blockquote> <blockquote> <blockquote> <p dir="auto">import numpy as np<br> x=np.array([[1,2],[3,4]])<br> print x<br> [[1 2]<br> [3 4]]<br> x+=x.T<br> print x<br> [[2 5]<br> [8 8]]</p> </blockquote> </blockquote> </blockquote> <p dir="auto">when writing code on such a high level of abstraction this behavior is not expected and imho wrong. At least a warning should be issued or better the in place operations should fall back to creating copies if the results are not correct otherwise.</p>
1
<p dir="auto">Allow toggling of whether a package is starred on atom.io from inside Atom.</p> <p dir="auto">This eases the install of Atom on other computers by using <code class="notranslate">apm stars --install</code>.</p>
<ul dir="auto"> <li>star packages</li> <li>unstar packages</li> <li>view your starred packages</li> </ul>
1
<p dir="auto">I don't really know how to classify this. Maybe just something that should be documented.</p> <p dir="auto">I have a <code class="notranslate">postcss.config.js</code> file that returns a function (i.e takes <code class="notranslate">ctx</code> as a parameter, returns a config object). That works fine in Next.js 9.1. But in 9.2, I get this error:</p> <blockquote> <p dir="auto">Error: Your custom PostCSS configuration may not export a function. Please export a plain object instead.</p> <p dir="auto">at getPostCssPlugins (/path/to/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:4:296)</p> </blockquote> <p dir="auto">Looking at the code for <code class="notranslate">plugin.ts</code>, this is obviously intentional behavior. I tried to find this breaking change documented somewhere (e.g. release notes, blog posts, etc.), but didn't find anything (the pull request with the change does provide some context, but it's hard to find). I get it, new version, things change. So possibly the only resolution to this is to document it somewhere in the release notes, maybe explain why it's changed.</p> <p dir="auto">If it's helpful, this is what my postcss.config.js file looked like before. Granted, what I'm using <code class="notranslate">ctx</code> for is probably unnecessary (sourcemaps seem to be generated just fine using Next.js default behavior). So it's not a big deal for me to get rid of it.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = ctx =&gt; ({ map: ctx.env === 'production' ? false : {inline: true}, plugins: { 'postcss-import': { resolve: createResolver({ alias: { '@css': path.resolve(__dirname, 'client/style'), '@client': path.resolve(__dirname, 'client'), }, }), }, 'postcss-rem': { baseline: 16, fallback: false, precision: 5, }, 'postcss-mixins': {}, 'postcss-simple-vars': {}, 'postcss-nested-ancestors': {}, 'postcss-nested': {}, 'postcss-custom-media': {}, 'postcss-calc': {mediaQueries: true}, 'postcss-preset-env': { stage: 0, browsers: 'last 2 versions', }, 'cssnano': { zindex: false, // autoprefixer is included in postcss-preset-env, so no need to do it again in nano autoprefixer: false, discardComments: {removeAll: true} }, 'postcss-reporter': {clearReportedMessages: true}, } })"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-en">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">ctx</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">map</span>: <span class="pl-s1">ctx</span><span class="pl-kos">.</span><span class="pl-c1">env</span> <span class="pl-c1">===</span> <span class="pl-s">'production'</span> ? <span class="pl-c1">false</span> : <span class="pl-kos">{</span><span class="pl-c1">inline</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">plugins</span>: <span class="pl-kos">{</span> <span class="pl-s">'postcss-import'</span>: <span class="pl-kos">{</span> <span class="pl-c1">resolve</span>: <span class="pl-en">createResolver</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">alias</span>: <span class="pl-kos">{</span> <span class="pl-s">'@css'</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'client/style'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s">'@client'</span>: <span class="pl-s1">path</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-s">'client'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-rem'</span>: <span class="pl-kos">{</span> <span class="pl-c1">baseline</span>: <span class="pl-c1">16</span><span class="pl-kos">,</span> <span class="pl-c1">fallback</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">precision</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-mixins'</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-simple-vars'</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-nested-ancestors'</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-nested'</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-custom-media'</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-calc'</span>: <span class="pl-kos">{</span><span class="pl-c1">mediaQueries</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-preset-env'</span>: <span class="pl-kos">{</span> <span class="pl-c1">stage</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">browsers</span>: <span class="pl-s">'last 2 versions'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'cssnano'</span>: <span class="pl-kos">{</span> <span class="pl-c1">zindex</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c">// autoprefixer is included in postcss-preset-env, so no need to do it again in nano</span> <span class="pl-c1">autoprefixer</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">discardComments</span>: <span class="pl-kos">{</span><span class="pl-c1">removeAll</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'postcss-reporter'</span>: <span class="pl-kos">{</span><span class="pl-c1">clearReportedMessages</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <h2 dir="auto">System information</h2> <ul dir="auto"> <li>OS: MacOS</li> <li>Browser (if applies): NA</li> <li>Version of Next.js: 9.2</li> </ul>
<h1 dir="auto">Bug report</h1> <h2 dir="auto">Describe the bug</h2> <p dir="auto">With the introduction of the <em>marvelous</em> <a href="https://github.com/zeit/next.js/issues/8626" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/8626/hovercard">Built-in CSS Support</a>, a new non-standard <a href="https://github.com/zeit/next.js/pull/9704" data-hovercard-type="pull_request" data-hovercard-url="/vercel/next.js/pull/9704/hovercard">PostCSS Config</a> plugin syntax was introduced.</p> <p dir="auto">This syntax requires that plugins listed in <code class="notranslate">postcss.config.js</code> be <strong>strings</strong> rather than <strong><code class="notranslate">require</code> statements</strong>. This breaks backwards compatibility and differs from the standard set by <a href="https://github.com/michael-ciniawsky/postcss-load-config#array">existing PostCSS documentation</a>.</p> <p dir="auto">Additionally, this makes it tough (or impossible) to share a common PostCSS configuration with additional tools like Storybook.js.</p> <h2 dir="auto">To Reproduce</h2> <p dir="auto">Steps to reproduce the behavior, please provide code snippets or a repository:</p> <ol dir="auto"> <li><code class="notranslate">yarn add -D tailwindcss autoprefixer</code></li> <li>Add the following <code class="notranslate">postcss.config.js</code>:</li> </ol> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = { plugins: [ require(&quot;tailwindcss&quot;), require(&quot;autoprefixer&quot;) ] };"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"tailwindcss"</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"autoprefixer"</span><span class="pl-kos">)</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <ol start="3" dir="auto"> <li><code class="notranslate">yarn next build</code></li> </ol> <h2 dir="auto">Expected behavior</h2> <ul dir="auto"> <li>The build succeeds, and either plugins imported with <code class="notranslate">require()</code> are supported</li> <li>Or the build fails, and a more descriptive error is shown in the build log.</li> </ul> <h2 dir="auto">Screenshots</h2> <p dir="auto">The following is shown when running <code class="notranslate">next build</code>:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: An unknown PostCSS plugin was provided (function creator() { -- 02:32:09 PM | var transformer = initializer.apply(void 0, arguments); 02:32:09 PM | transformer.postcssPlugin = name; 02:32:09 PM | transformer.postcssVersion = new _processor.default().version; 02:32:09 PM | return transformer; 02:32:09 PM | }). 02:32:09 PM | &gt; Build error occurred"><pre class="notranslate"><code class="notranslate">Error: An unknown PostCSS plugin was provided (function creator() { -- 02:32:09 PM | var transformer = initializer.apply(void 0, arguments); 02:32:09 PM | transformer.postcssPlugin = name; 02:32:09 PM | transformer.postcssVersion = new _processor.default().version; 02:32:09 PM | return transformer; 02:32:09 PM | }). 02:32:09 PM | &gt; Build error occurred </code></pre></div> <h2 dir="auto">System information</h2> <ul dir="auto"> <li>OS: macOS</li> <li>Version of Next.js: 9.2</li> </ul> <h2 dir="auto">Additional context</h2> <p dir="auto">This work was likely done to be able to identify, dedupe, and acknowledge Next's default PostCSS plugins — and it's likely the solution to this issue is nothing more than better documentation.</p> <p dir="auto">Here are a couple proposed solutions:</p> <h3 dir="auto">1. Support <code class="notranslate">require()</code> statements in PostCSS config</h3> <p dir="auto">I'd rely on <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Timer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Timer">@Timer</a>'s knowledge here, as there are likely other consequences (notably: not being able to inspect and dedupe plugins).</p> <h3 dir="auto">2. Display a warning/error that indicates deprecated behavior</h3> <p dir="auto">This would be a simple check in <code class="notranslate">packages/next/build/webpack/config/blocks/css/plugins.ts</code> to see if the plugin is a function:</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="else if (typeof plugin === 'function') { console.error( `${chalk.red.bold( 'Error' )}: A PostCSS Plugin must be provided as a ${chalk.bold( 'string' )}. Instead, we got a function imported with require().` ) }"><pre class="notranslate"><span class="pl-s1">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">plugin</span> <span class="pl-c1">===</span> <span class="pl-s">'function'</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">error</span><span class="pl-kos">(</span> <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">chalk</span><span class="pl-kos">.</span><span class="pl-c1">red</span><span class="pl-kos">.</span><span class="pl-en">bold</span><span class="pl-kos">(</span></span></span> <span class="pl-s"><span class="pl-s1"> <span class="pl-s">'Error'</span></span></span> <span class="pl-s"><span class="pl-s1"> <span class="pl-kos">)</span><span class="pl-kos">}</span></span>: A PostCSS Plugin must be provided as a <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">chalk</span><span class="pl-kos">.</span><span class="pl-en">bold</span><span class="pl-kos">(</span></span></span> <span class="pl-s"><span class="pl-s1"> <span class="pl-s">'string'</span></span></span> <span class="pl-s"><span class="pl-s1"> <span class="pl-kos">)</span><span class="pl-kos">}</span></span>. Instead, we got a function imported with require().`</span> <span class="pl-kos">)</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">I'm happy to submit PRs for either of these solutions! But looking for guidance from the core team.</p>
1
<p dir="auto">I'm trying to use <code class="notranslate">TF_LoadLibrary</code> on a mac and I keep getting errors such as:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: org.platanios.tensorflow.jni.TensorFlow$NativeException: dlopen(/var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib, 6): Symbol not found: __ZN10tensorflow15shape_inference12UnknownShapeEPNS0_16InferenceContextE Referenced from: /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib Expected in: flat namespace in /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib"><pre class="notranslate"><code class="notranslate">Caused by: org.platanios.tensorflow.jni.TensorFlow$NativeException: dlopen(/var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib, 6): Symbol not found: __ZN10tensorflow15shape_inference12UnknownShapeEPNS0_16InferenceContextE Referenced from: /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib Expected in: flat namespace in /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib </code></pre></div> <p dir="auto">The same thing happens when I try to load the compiled dylib file through Python directly. It was compiled it using <code class="notranslate">-D_GLIBCXX_USE_CXX11_ABI=0</code> and <code class="notranslate">-undefined dynamic_lookup</code> for the linker. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/asimshankar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/asimshankar">@asimshankar</a></p>
<p dir="auto">As reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="115914766" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/10" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/10/hovercard?comment_id=272045853&amp;comment_type=issue_comment" href="https://github.com/tensorflow/tensorflow/issues/10#issuecomment-272045853">#10 (comment)</a> , the following test (at head: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3/hovercard" href="https://github.com/tensorflow/tensorflow/commit/d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3"><tt>d4b5c60</tt></a>):</p> <div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package bug import ( &quot;testing&quot; tf &quot;github.com/tensorflow/tensorflow/tensorflow/go&quot; &quot;github.com/tensorflow/tensorflow/tensorflow/go/op&quot; ) func TestBug(t *testing.T) { scope := op.NewScope() op.Placeholder(scope.Subscope(&quot;x&quot;), tf.Float) op.Placeholder(scope.Subscope(&quot;y&quot;), tf.Float) if _, err := scope.Finalize(); err != nil { t.Fatal(err) } }"><pre class="notranslate"><span class="pl-k">package</span> bug <span class="pl-k">import</span> ( <span class="pl-s">"testing"</span> tf <span class="pl-s">"github.com/tensorflow/tensorflow/tensorflow/go"</span> <span class="pl-s">"github.com/tensorflow/tensorflow/tensorflow/go/op"</span> ) <span class="pl-k">func</span> <span class="pl-en">TestBug</span>(<span class="pl-s1">t</span> <span class="pl-c1">*</span>testing.<span class="pl-smi">T</span>) { <span class="pl-s1">scope</span> <span class="pl-c1">:=</span> <span class="pl-s1">op</span>.<span class="pl-en">NewScope</span>() <span class="pl-s1">op</span>.<span class="pl-en">Placeholder</span>(<span class="pl-s1">scope</span>.<span class="pl-en">Subscope</span>(<span class="pl-s">"x"</span>), <span class="pl-s1">tf</span>.<span class="pl-c1">Float</span>) <span class="pl-s1">op</span>.<span class="pl-en">Placeholder</span>(<span class="pl-s1">scope</span>.<span class="pl-en">Subscope</span>(<span class="pl-s">"y"</span>), <span class="pl-s1">tf</span>.<span class="pl-c1">Float</span>) <span class="pl-k">if</span> <span class="pl-s1">_</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">scope</span>.<span class="pl-en">Finalize</span>(); <span class="pl-s1">err</span> <span class="pl-c1">!=</span> <span class="pl-c1">nil</span> { <span class="pl-s1">t</span>.<span class="pl-en">Fatal</span>(<span class="pl-s1">err</span>) } }</pre></div> <p dir="auto">fails with:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--- FAIL: TestBug (0.01s) bug_test.go:15: failed to add operation &quot;Placeholder&quot;: Duplicate node name in graph: 'Placeholder' (Stacktrace: goroutine 19 [running]: runtime/debug.Stack(0x0, 0x0, 0x0) /usr/local/go/src/runtime/debug/stack.go:24 +0x79 github.com/tensorflow/tensorflow/tensorflow/go/op.(*Scope).UpdateErr(0xc420072420, 0x411b8ac, 0xb, 0x4196640, 0xc42007c030) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:106 +0x72 github.com/tensorflow/tensorflow/tensorflow/go/op.(*Scope).AddOperation(0xc420072420, 0x411b8ac, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc420072450, 0x4108b00) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:70 +0xbf github.com/tensorflow/tensorflow/tensorflow/go/op.Placeholder(0xc420072420, 0x1, 0x0, 0x0, 0x0, 0xc42006e4f0, 0x0) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/wrappers.go:4734 +0x1c7 github.com/tensorflow/tensorflow/tensorflow/go/b10.TestBug(0xc420098180) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/b10/bug_test.go:13 +0xd2 testing.tRunner(0xc420098180, 0x4129d88) /usr/local/go/src/testing/testing.go:610 +0x81 created by testing.(*T).Run /usr/local/go/src/testing/testing.go:646 +0x2ec )"><pre class="notranslate">--- FAIL: TestBug (0.01s) bug_test.go:15: failed to add operation <span class="pl-s"><span class="pl-pds">"</span>Placeholder<span class="pl-pds">"</span></span>: Duplicate node name <span class="pl-k">in</span> graph: <span class="pl-s"><span class="pl-pds">'</span>Placeholder<span class="pl-pds">'</span></span> (Stacktrace: goroutine 19 [running]: runtime/debug.Stack(0x0, 0x0, 0x0) /usr/local/go/src/runtime/debug/stack.go:24 +0x79 github.com/tensorflow/tensorflow/tensorflow/go/op.(<span class="pl-k">*</span>Scope).UpdateErr(0xc420072420, 0x411b8ac, 0xb, 0x4196640, 0xc42007c030) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:106 +0x72 github.com/tensorflow/tensorflow/tensorflow/go/op.(<span class="pl-k">*</span>Scope).AddOperation(0xc420072420, 0x411b8ac, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc420072450, 0x4108b00) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:70 +0xbf github.com/tensorflow/tensorflow/tensorflow/go/op.Placeholder(0xc420072420, 0x1, 0x0, 0x0, 0x0, 0xc42006e4f0, 0x0) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/wrappers.go:4734 +0x1c7 github.com/tensorflow/tensorflow/tensorflow/go/b10.TestBug(0xc420098180) /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/b10/bug_test.go:13 +0xd2 testing.tRunner(0xc420098180, 0x4129d88) /usr/local/go/src/testing/testing.go:610 +0x81 created by testing.(<span class="pl-k">*</span>T).Run /usr/local/go/src/testing/testing.go:646 +0x2ec )</pre></div> <p dir="auto">(Thanks for pointing this out <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sdeoras/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sdeoras">@sdeoras</a>).</p>
0
<p dir="auto">Hey,</p> <p dir="auto">I've noticed that on 1.3.0-beta.1 when petset is deleted its pods stay alive:</p> <p dir="auto">core@master ~ $ kubectl get petsets | grep mariadb<br> mariadb-galera 3 3 7s<br> core@master ~ $ kubectl get pods | grep mariadb-galera<br> mariadb-galera-0 1/1 Running 0 5s<br> mariadb-galera-1 1/1 Running 0 4s<br> mariadb-galera-2 1/1 Running 0 3s<br> core@master ~ $ kubectl delete petset mariadb-galera<br> petset "mariadb-galera" deleted<br> core@master ~ $ kubectl get pods | grep mariadb-galera<br> mariadb-galera-0 1/1 Running 0 18s<br> mariadb-galera-1 1/1 Running 0 17s<br> mariadb-galera-2 1/1 Running 0 16s<br> core@master ~ $ kubectl get petsets | grep mariadb-galera<br> core@master ~ $</p> <p dir="auto">Cheers</p>
<p dir="auto">As part of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45429704" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1702" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1702/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1702">#1702</a>, we would like to use declarative configuration to maintain the state of a Kubernetes cluster. We do this by issuing the local objects to the server as JSON HTTP PATCH requests. As per the <a href="https://tools.ietf.org/html/rfc7386" rel="nofollow">JSON merge patch spec</a>, all maps are merged together, keys that are omitted from the patch are left untouched in the document, and if you want to delete a key you simply use <code class="notranslate">key: null</code>. This is exactly what we want in config reconciliation. However, lists present a special challenge in that the spec says they should always be replaced. Often that isn't what we want.</p> <p dir="auto">Let's say we start with the following Pod:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: containers: - name: nginx image: nginx-1.0"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">containers</span>: - <span class="pl-ent">name</span>: <span class="pl-s">nginx</span> <span class="pl-ent">image</span>: <span class="pl-s">nginx-1.0</span></pre></div> <p dir="auto">...and we POST that to the server. Then a controller comes along and adds another container to this pod before it starts up. (Not possible today but likely a scenario we will want to support.)</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: containers: - name: nginx image: nginx-1.0 - name: log-tailer image: log-tailer-1.0"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">containers</span>: - <span class="pl-ent">name</span>: <span class="pl-s">nginx</span> <span class="pl-ent">image</span>: <span class="pl-s">nginx-1.0</span> - <span class="pl-ent">name</span>: <span class="pl-s">log-tailer</span> <span class="pl-ent">image</span>: <span class="pl-s">log-tailer-1.0</span></pre></div> <p dir="auto">If you try to apply the local config as a JSON PATCH to the remote config, you <em>should</em> get a no-op: the container that we've specified (nginx) still exists in the server, and extra containers inside the <code class="notranslate">containers</code> field are not of concern to us (and we should not clobber them). However, there is no way to programatically see if this is a list that should be merged versus a list that should <em>not</em> be merged. Here is an example of a list that should <em>not</em> be merged (the <code class="notranslate">ExecAction</code> API object), and instead should be fully replaced when it is modified:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="command: - nginx - -t - -c - /etc/nginx.conf"><pre class="notranslate"><span class="pl-ent">command</span>: - <span class="pl-s">nginx</span> - <span class="pl-s">-t</span> - <span class="pl-s">-c</span> - <span class="pl-s">/etc/nginx.conf</span></pre></div> <p dir="auto">If the remote server were to look like this...</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="command: - httpd - -X - -f - /etc/httpd.conf"><pre class="notranslate"><span class="pl-ent">command</span>: - <span class="pl-s">httpd</span> - <span class="pl-s">-X</span> - <span class="pl-s">-f</span> - <span class="pl-s">/etc/httpd.conf</span></pre></div> <p dir="auto">...then if I were to patch the remote server with the local config, it should NOT merge these lists together - it should actually replace the <code class="notranslate">command</code> field wholesale with the one on disk.</p> <p dir="auto">The semantic knowledge of which lists should be merged like maps versus which lists should be replaced completely belongs in the API server. There are two ways to accomplish this.</p> <h3 dir="auto">Change mergeable lists to maps</h3> <p dir="auto">If a list is mergeable, we should make it a map in the API server of a key to the objects. See a thorough discussion of this alternative to lists in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="46937389" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/2004" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/2004/hovercard?comment_id=60641437&amp;comment_type=issue_comment" href="https://github.com/kubernetes/kubernetes/issues/2004#issuecomment-60641437">#2004 (comment)</a>. The above example with pod spec would transform to this:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: containers: nginx: image: nginx-1.0"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">containers</span>: <span class="pl-ent">nginx</span>: <span class="pl-ent">image</span>: <span class="pl-s">nginx-1.0</span></pre></div> <p dir="auto">And the remote side would look like this:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: containers: nginx: image: nginx-1.0 log-tailer: image: log-tailer-1.0"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">containers</span>: <span class="pl-ent">nginx</span>: <span class="pl-ent">image</span>: <span class="pl-s">nginx-1.0</span> <span class="pl-ent">log-tailer</span>: <span class="pl-ent">image</span>: <span class="pl-s">log-tailer-1.0</span></pre></div> <p dir="auto">This enables us to merge the maps properly. If you wanted to actually delete the <code class="notranslate">nginx</code> container, you would put <code class="notranslate">nginx: null</code> in the local patch. (We have a design which will automatically generate the correct nulls of things you've deleted based on an annotation containing your previously submitted config - this design will be written into <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="45429704" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1702" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1702/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1702">#1702</a>.)</p> <p dir="auto">The big advantage of this method though is that it's really obvious what gets merged and what doesn't (lists are always replaced, maps are always merged) and we can use a standard JSON PATCH library to accept patches on the server and we can directly conform to the <a href="https://tools.ietf.org/html/rfc7386" rel="nofollow">JSON merge patch spec</a>. A side benefit is that the list is readily accessible in a meaningful way (indexed by primary key) which avoids manually indexing lists all the time.</p> <p dir="auto">The downside (as outlined in <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jbeda/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jbeda">@jbeda</a>'s comment) is that the field to use as the key for the map is not always obvious. We can implement it as a swagger annotation to mitigate that. The bigger issue is that if a struct has no other required fields besides the map field, it can get awkward. For example, the PublicIP's field of the service spec is likely something we would want to merge. It's a <code class="notranslate">[]string</code> which looks like this:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: publicIPs: - 67.1.1.10 - 67.1.1.11"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">publicIPs</span>: - <span class="pl-s">67.1.1.10</span> - <span class="pl-s">67.1.1.11</span></pre></div> <p dir="auto">If we made it a mergeable map (since you may want someone to inject a public IP into a service), then we'd have to change it to look like something like this:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: publicIPs: 67.1.1.10: ip: 67.1.1.10 67.1.1.11: ip: 67.1.1.11"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">publicIPs</span>: <span class="pl-ent">67.1.1.10</span>: <span class="pl-ent">ip</span>: <span class="pl-s">67.1.1.10</span> <span class="pl-ent">67.1.1.11</span>: <span class="pl-ent">ip</span>: <span class="pl-s">67.1.1.11</span></pre></div> <p dir="auto">There is an optimization we could do where IP would be automatically filled by API server as a default, which would make it look like this:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="spec: publicIPs: 67.1.1.10: {} 67.1.1.11: {}"><pre class="notranslate"><span class="pl-ent">spec</span>: <span class="pl-ent">publicIPs</span>: <span class="pl-ent">67.1.1.10</span>: <span class="pl-s">{}</span> <span class="pl-ent">67.1.1.11</span>: <span class="pl-s">{}</span></pre></div> <p dir="auto">But in any case it's still a bit ugly. There may be other ways to beautify it and/or solve this problem - very open to suggestions here.</p> <h3 dir="auto">Swagger annotation to tell API server which lists should be merged</h3> <p dir="auto">The alternative is to do the merge determination more dynamically. When API server gets a PATCH, it introspects into the lists and checks against a Swagger annotation to see where the list should be replaced or merged. If it's one that should be merged, it will need a mergeKey which tells it what key to use to do the merging. In the above case of containers, it would be <code class="notranslate">name</code>, but in the publicIP's case it would just uniqify and merge the values themselves. While this lets us not change the API, this requires us to implement and maintain a custom JSON PATCH implementation which will not be fun. It also goes against POLA when your PATCH request will not behave as <a href="https://tools.ietf.org/html/rfc7386" rel="nofollow">the spec</a> defines.</p> <h3 dir="auto">What should we do?</h3> <p dir="auto">Neither of these options are fantastic, but I think we need to implement this distinction as part of the API. Please discuss and detail other options if you can think of any.</p> <p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bgrant0607/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bgrant0607">@bgrant0607</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/derekwaynecarr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/derekwaynecarr">@derekwaynecarr</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mikedanese/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mikedanese">@mikedanese</a></p>
0
<p dir="auto">Hello,</p> <p dir="auto">I couldn't find earlier posted questions about this, but if there are, excuse me for posting a duplicate.<br> I wanted to animate my progress bar (from left to right), but when inspecting the existing rules, I saw there is already a built-in transition for progress bars:</p> <div class="highlight highlight-source-css notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=".progress-bar { /*Other CSS Rules */ -webkit-transition: width .6s ease; transition: width .6s ease; }"><pre class="notranslate">.<span class="pl-c1">progress-bar</span> { <span class="pl-c">/*Other CSS Rules */</span> <span class="pl-c1">-webkit-transition</span><span class="pl-kos">:</span> width <span class="pl-c1">.6<span class="pl-smi">s</span></span> ease; <span class="pl-c1">transition</span><span class="pl-kos">:</span> width <span class="pl-c1">.6<span class="pl-smi">s</span></span> ease; }</pre></div> <p dir="auto">However, I hadn't noticed the transition at all, so I added</p> <div class="highlight highlight-source-css notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=".progress-bar { -webkit-transition: width 4s ease; transition: width 4s ease; }"><pre class="notranslate">.<span class="pl-c1">progress-bar</span> { <span class="pl-c1">-webkit-transition</span><span class="pl-kos">:</span> width <span class="pl-c1">4<span class="pl-smi">s</span></span> ease; <span class="pl-c1">transition</span><span class="pl-kos">:</span> width <span class="pl-c1">4<span class="pl-smi">s</span></span> ease; }</pre></div> <p dir="auto">to my (adjustments) stylesheet to be sure to notice the animation.<br> However, it still didn't animate on page load (and I used Google Chrome Developer Tools to verify this new rule overrode the old one).</p> <p dir="auto">Why doesn't this work? <em>(Neither the <code class="notranslate">.6s</code> and the <code class="notranslate">4s</code>)</em></p> <p dir="auto">The CSS Rule for progress bars is actually</p> <div class="highlight highlight-source-css notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=".progress-bar { float: left; width: 0; height: 100%; font-size: 12px; line-height: 20px; color: #fff; text-align: center; background-color: #428bca; -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); -webkit-transition: width .6s ease; transition: width .6s ease; }"><pre class="notranslate">.<span class="pl-c1">progress-bar</span> { <span class="pl-c1">float</span><span class="pl-kos">:</span> left; <span class="pl-c1">width</span><span class="pl-kos">:</span> <span class="pl-c1">0</span>; <span class="pl-c1">height</span><span class="pl-kos">:</span> <span class="pl-c1">100<span class="pl-smi">%</span></span>; <span class="pl-c1">font-size</span><span class="pl-kos">:</span> <span class="pl-c1">12<span class="pl-smi">px</span></span>; <span class="pl-c1">line-height</span><span class="pl-kos">:</span> <span class="pl-c1">20<span class="pl-smi">px</span></span>; <span class="pl-c1">color</span><span class="pl-kos">:</span> <span class="pl-pds"><span class="pl-kos">#</span>fff</span>; <span class="pl-c1">text-align</span><span class="pl-kos">:</span> center; <span class="pl-c1">background-color</span><span class="pl-kos">:</span> <span class="pl-pds"><span class="pl-kos">#</span>428bca</span>; <span class="pl-c1">-webkit-box-shadow</span><span class="pl-kos">:</span> inset <span class="pl-c1">0</span> <span class="pl-c1">-1<span class="pl-smi">px</span></span> <span class="pl-c1">0</span> <span class="pl-en">rgba</span>(<span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">0.15</span>); <span class="pl-c1">box-shadow</span><span class="pl-kos">:</span> inset <span class="pl-c1">0</span> <span class="pl-c1">-1<span class="pl-smi">px</span></span> <span class="pl-c1">0</span> <span class="pl-en">rgba</span>(<span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">0.15</span>); <span class="pl-c1">-webkit-transition</span><span class="pl-kos">:</span> width <span class="pl-c1">.6<span class="pl-smi">s</span></span> ease; <span class="pl-c1">transition</span><span class="pl-kos">:</span> width <span class="pl-c1">.6<span class="pl-smi">s</span></span> ease; }</pre></div> <p dir="auto">so as you can see, first <code class="notranslate">width:0;</code> is set, and later I set, like the <a href="http://getbootstrap.com/components/#progress" rel="nofollow">Bootstrap Example</a>, an inline rule <code class="notranslate">style="width: 80%;"</code>...</p> <p dir="auto">If I disable (and reenable) this <code class="notranslate">style="width: 80%;"</code> using the Google Chrome Developer Tools, it <em>does</em> animate, so my problem is <strong>it does not animate on page load</strong>...</p> <p dir="auto"><strong>Am I missing something?</strong></p> <p dir="auto"><em>My progress bar:</em></p> <div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;div class=&quot;progress-bar progress-bar-success&quot; role=&quot;progressbar&quot; aria-valuenow=&quot;80&quot; aria-valuemin=&quot;0&quot; aria-valuemax=&quot;100&quot; style=&quot;width: 80%&quot;&gt; &lt;span class=&quot;sr-only&quot;&gt;80% Complete&lt;/span&gt; &lt;/div&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>="<span class="pl-s">progress-bar progress-bar-success</span>" <span class="pl-c1">role</span>="<span class="pl-s">progressbar</span>" <span class="pl-c1">aria-valuenow</span>="<span class="pl-s">80</span>" <span class="pl-c1">aria-valuemin</span>="<span class="pl-s">0</span>" <span class="pl-c1">aria-valuemax</span>="<span class="pl-s">100</span>" <span class="pl-c1">style</span>="<span class="pl-s">width: 80%</span>"<span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;</span><span class="pl-ent">span</span> <span class="pl-c1">class</span>="<span class="pl-s">sr-only</span>"<span class="pl-kos">&gt;</span>80% Complete<span class="pl-kos">&lt;/</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span> <span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span></pre></div> <p dir="auto"><em>I'm using an iMac with Google Chrome. I tested it on FireFox as well, same problem, so, uhm... It's most likely <code class="notranslate">I</code> am missing something</em><br> <em>I use Bootstrap 3.0.2, but that's irrelevant, because you can see in my question it happens as well on the official Bootstrap Site.</em></p>
<p dir="auto">When using the content function for a popover, it seems to be executed twice when the trigger occurs.</p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$(&quot;#blah&quot;).popover({ placement: 'bottom', trigger: 'click', content: function () { console.log(&quot;Get content&quot;); return &quot;Hi&quot;; } });"><pre class="notranslate"><span class="pl-en">$</span><span class="pl-kos">(</span><span class="pl-s">"#blah"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">popover</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">placement</span>: <span class="pl-s">'bottom'</span><span class="pl-kos">,</span> <span class="pl-c1">trigger</span>: <span class="pl-s">'click'</span><span class="pl-kos">,</span> <span class="pl-en">content</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"Get content"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-s">"Hi"</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
0
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Building Dataframe (reused from example, the fact that it uses datetime and numpy is probably not that important) date_range = pd.date_range(start=dt.datetime(2017,1,1), end=dt.datetime(2020,12,31), freq='W') to_concat = [] for val in range(1,5): frame_tmp = pd.DataFrame() frame_tmp['DT'] = date_range frame_tmp['type'] = val frame_tmp['value'] = np.random.randint(1, 6, frame_tmp.shape[0]) to_concat.append(frame_tmp) df = pd.concat(to_concat, ignore_index=True) # Does not work under pandas 0.23.0 and 0.23.1 worked in 0.22 and for some versions before df.set_index('DT').groupby(level=0)['value'].expanding().mean() # Workaround not setting as index is fine df.groupby(['DT'])['value'].expanding().mean() "><pre class="notranslate"><span class="pl-c"># Building Dataframe (reused from example, the fact that it uses datetime and numpy is probably not that important) </span> <span class="pl-s1">date_range</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s1">start</span><span class="pl-c1">=</span><span class="pl-s1">dt</span>.<span class="pl-en">datetime</span>(<span class="pl-c1">2017</span>,<span class="pl-c1">1</span>,<span class="pl-c1">1</span>), <span class="pl-s1">end</span><span class="pl-c1">=</span><span class="pl-s1">dt</span>.<span class="pl-en">datetime</span>(<span class="pl-c1">2020</span>,<span class="pl-c1">12</span>,<span class="pl-c1">31</span>), <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'W'</span>) <span class="pl-s1">to_concat</span> <span class="pl-c1">=</span> [] <span class="pl-k">for</span> <span class="pl-s1">val</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">1</span>,<span class="pl-c1">5</span>): <span class="pl-s1">frame_tmp</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>() <span class="pl-s1">frame_tmp</span>[<span class="pl-s">'DT'</span>] <span class="pl-c1">=</span> <span class="pl-s1">date_range</span> <span class="pl-s1">frame_tmp</span>[<span class="pl-s">'type'</span>] <span class="pl-c1">=</span> <span class="pl-s1">val</span> <span class="pl-s1">frame_tmp</span>[<span class="pl-s">'value'</span>] <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">1</span>, <span class="pl-c1">6</span>, <span class="pl-s1">frame_tmp</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>]) <span class="pl-s1">to_concat</span>.<span class="pl-en">append</span>(<span class="pl-s1">frame_tmp</span>) <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>(<span class="pl-s1">to_concat</span>, <span class="pl-s1">ignore_index</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-c"># Does not work under pandas 0.23.0 and 0.23.1 worked in 0.22 and for some versions before</span> <span class="pl-s1">df</span>.<span class="pl-en">set_index</span>(<span class="pl-s">'DT'</span>).<span class="pl-en">groupby</span>(<span class="pl-s1">level</span><span class="pl-c1">=</span><span class="pl-c1">0</span>)[<span class="pl-s">'value'</span>].<span class="pl-en">expanding</span>().<span class="pl-en">mean</span>() <span class="pl-c"># Workaround not setting as index is fine</span> <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>([<span class="pl-s">'DT'</span>])[<span class="pl-s">'value'</span>].<span class="pl-en">expanding</span>().<span class="pl-en">mean</span>()</pre></div> <h4 dir="auto">Problem description</h4> <p dir="auto">When using expanding().mean() in a groupby on index as in the above code, pandas 0.23.1 and 0.23.0 produce an error:<br> ValueError: Duplicated level name: "DT", assigned to level 1, is already used for level 0.</p> <p dir="auto">Previous version would insert another level with the same name. So it is probably linked with a change in error being thrown.</p> <h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4> <details> <h2 dir="auto">INSTALLED VERSIONS</h2> <p dir="auto">commit: None<br> python: 3.6.6.final.0<br> python-bits: 64<br> OS: Linux<br> OS-release: 4.13.0-45-generic<br> machine: x86_64<br> processor: x86_64<br> byteorder: little<br> LC_ALL: None<br> LANG: en_US.UTF-8<br> LOCALE: en_US.UTF-8</p> <p dir="auto">pandas: 0.23.1<br> pytest: None<br> pip: 10.0.1<br> setuptools: 39.2.0<br> Cython: None<br> numpy: 1.14.5<br> scipy: None<br> pyarrow: None<br> xarray: None<br> IPython: 6.4.0<br> sphinx: None<br> patsy: None<br> dateutil: 2.7.3<br> pytz: 2018.5<br> blosc: None<br> bottleneck: None<br> tables: 3.4.4<br> numexpr: 2.6.5<br> feather: None<br> matplotlib: None<br> openpyxl: None<br> xlrd: None<br> xlwt: None<br> xlsxwriter: None<br> lxml: None<br> bs4: None<br> html5lib: 1.0.1<br> sqlalchemy: None<br> pymysql: None<br> psycopg2: None<br> jinja2: 2.10<br> s3fs: None<br> fastparquet: None<br> pandas_gbq: None<br> pandas_datareader: None</p> </details>
<p dir="auto">Hi,<br> I updated to version 0.23.0 and all of a sudden the following code breaks:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd df = pd.DataFrame(data={'date': list(pd.date_range('5.1.2018', '5.10.2018')), 'vals': list(range(10))}) df.groupby([df.date.dt.month, df.date.dt.day])['vals'].sum() ValueError: Duplicated level name: &quot;date&quot;, assigned to level 1, is already used for level 0."><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span><span class="pl-c1">=</span>{<span class="pl-s">'date'</span>: <span class="pl-en">list</span>(<span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s">'5.1.2018'</span>, <span class="pl-s">'5.10.2018'</span>)), <span class="pl-s">'vals'</span>: <span class="pl-en">list</span>(<span class="pl-en">range</span>(<span class="pl-c1">10</span>))}) <span class="pl-s1">df</span>.<span class="pl-en">groupby</span>([<span class="pl-s1">df</span>.<span class="pl-s1">date</span>.<span class="pl-s1">dt</span>.<span class="pl-s1">month</span>, <span class="pl-s1">df</span>.<span class="pl-s1">date</span>.<span class="pl-s1">dt</span>.<span class="pl-s1">day</span>])[<span class="pl-s">'vals'</span>].<span class="pl-en">sum</span>() <span class="pl-v">ValueError</span>: <span class="pl-v">Duplicated</span> <span class="pl-s1">level</span> <span class="pl-s1">name</span>: <span class="pl-s">"date"</span>, <span class="pl-s1">assigned</span> <span class="pl-s1">to</span> <span class="pl-s1">level</span> <span class="pl-c1">1</span>, <span class="pl-c1">is</span> <span class="pl-s1">already</span> <span class="pl-s1">used</span> <span class="pl-k">for</span> <span class="pl-s1">level</span> <span class="pl-c1">0.</span></pre></div> <h3 dir="auto">Expected output:</h3> <p dir="auto">Using version 0.22.0 the same code yields the following:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="date date 5 1 0 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 Name: vals, dtype: int64"><pre class="notranslate"><span class="pl-s1">date</span> <span class="pl-s1">date</span> <span class="pl-c1">5</span> <span class="pl-c1">1</span> <span class="pl-c1">0</span> <span class="pl-c1">2</span> <span class="pl-c1">1</span> <span class="pl-c1">3</span> <span class="pl-c1">2</span> <span class="pl-c1">4</span> <span class="pl-c1">3</span> <span class="pl-c1">5</span> <span class="pl-c1">4</span> <span class="pl-c1">6</span> <span class="pl-c1">5</span> <span class="pl-c1">7</span> <span class="pl-c1">6</span> <span class="pl-c1">8</span> <span class="pl-c1">7</span> <span class="pl-c1">9</span> <span class="pl-c1">8</span> <span class="pl-c1">10</span> <span class="pl-c1">9</span> <span class="pl-v">Name</span>: <span class="pl-s1">vals</span>, <span class="pl-s1">dtype</span>: <span class="pl-s1">int64</span></pre></div> <p dir="auto">It obviously contains duplicated level names. I get why this might be a problem, but as of version 0.23.0 it's not possible to specify the resulting level names.</p>
1
<p dir="auto">Hi,</p> <p dir="auto">Chinese font not working in my app and all symbols are replaced by squares...<br> An Idea ?</p> <p dir="auto">Thanks<br> Cyril</p>
<p dir="auto">On Linux if no font is specified CJK characters will be showed as unrecognized characters, see also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="65861810" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/6214" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/6214/hovercard" href="https://github.com/atom/atom/issues/6214">atom/atom#6214</a>.</p>
1
<p dir="auto">A quick and easy way to get ode23 and ode45 like in MATLAB is:</p> <p dir="auto"><a href="http://www.netlib.org/ode/rksuite/" rel="nofollow">http://www.netlib.org/ode/rksuite/</a></p> <p dir="auto">The state of the art is SUNDIALS, but it is no longer maintained. The lead developer went to develop video games! It is widely used in the national labs, and can give us ode15s.</p> <p dir="auto"><a href="https://computation.llnl.gov/casc/sundials/main.html" rel="nofollow">https://computation.llnl.gov/casc/sundials/main.html</a></p> <p dir="auto">The long term strategy may simply be to implement these solvers in julia itself. The design of the Matlab ODE suite is described in:</p> <p dir="auto"><a href="http://www.mathworks.com/help/pdf_doc/otherdocs/ode_suite.pdf" rel="nofollow">http://www.mathworks.com/help/pdf_doc/otherdocs/ode_suite.pdf</a></p>
<p dir="auto">I just compiled and ran Julie on a AMD, 64bit, Linux Mint distribution machine.</p> <p dir="auto">In the manual/docs the following examples are given</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="x::Int8 = 10 type error: typeassert: expected Int8, got Int64 ----------- function gethostname() hostname = Array(Uint8, 128) ccall( (:gethostname, &quot;libc&quot;), Int32, (Ptr{Uint8}, Ulong), hostname, length(hostname)) return bytestring(convert(Ptr{Uint8}, hostname)) end gethostname() error compiling gethostname: Ulong not defined ------------"><pre class="notranslate"><code class="notranslate">x::Int8 = 10 type error: typeassert: expected Int8, got Int64 ----------- function gethostname() hostname = Array(Uint8, 128) ccall( (:gethostname, "libc"), Int32, (Ptr{Uint8}, Ulong), hostname, length(hostname)) return bytestring(convert(Ptr{Uint8}, hostname)) end gethostname() error compiling gethostname: Ulong not defined ------------ </code></pre></div> <p dir="auto">I realize this is probably due to a compilation error or system modifications; or some such.<br> I can't find a reference to Ulong failures in google though.<br> A pointer to relevant documentation, system/compiler dumps, would be appreciated. I realize that<br> Mint, 64 bit, AMD<br> is not a through description but I don't want to clutter up the board with useless information.<br> I do know (more or less) how to do strace and such if needed.<br> Ray</p>
0
<p dir="auto">Hi,</p> <p dir="auto">Can elasticsearch be configured to listen on multiple IPs, but not on all?<br> So I want it to listen on all private ips + localhost, but not on the public ips all present on the same node.</p> <p dir="auto">Thanks</p>
<p dir="auto">Right now you can bind Elasticsearch to only a single address with either:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="network.bind_host: &quot;some_ip&quot;"><pre class="notranslate"><span class="pl-ent">network.bind_host</span>: <span class="pl-s"><span class="pl-pds">"</span>some_ip<span class="pl-pds">"</span></span></pre></div> <p dir="auto">or</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="network.host: &quot;some_ip&quot;"><pre class="notranslate"><span class="pl-ent">network.host</span>: <span class="pl-s"><span class="pl-pds">"</span>some_ip<span class="pl-pds">"</span></span></pre></div> <p dir="auto">It'd be convenient to be able to bind to multiple hosts like so:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="network.bind_host: [ &quot;some_ip&quot;, &quot;some_other_ip&quot; ]"><pre class="notranslate"><span class="pl-ent">network.bind_host</span>: <span class="pl-s">[ "some_ip", "some_other_ip" ]</span></pre></div> <p dir="auto">In particular it'd allow the convenient configuration:</p> <div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="network.bind_host: [ &quot;some_data_center_accessible_ip&quot;, &quot;localhost&quot; ] network.publish_host: &quot;some_data_center_accessible_ip&quot;"><pre class="notranslate"><span class="pl-ent">network.bind_host</span>: <span class="pl-s">[ "some_data_center_accessible_ip", "localhost" ]</span> <span class="pl-ent">network.publish_host</span>: <span class="pl-s"><span class="pl-pds">"</span>some_data_center_accessible_ip<span class="pl-pds">"</span></span></pre></div> <p dir="auto">Which would allow elasticsearch to respond to requests to localhost.</p>
1
<p dir="auto">'flutter doctor' worked correctly it suggested I update so then<br> I ran 'flutter upgrade' as well as updating my macos and xcode. Then ran xcode and which installed additional updates.</p> <p dir="auto">Karls-MBP-2:~ karllilley$ flutter doctor -v<br> [✓] Flutter (Channel beta, v0.2.3, on Mac OS X 10.13.4 17E199, locale en-US)<br> • Flutter version 0.2.3 at /Users/karllilley/flutter<br> • Framework revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/5a58b36e36b8d7aace89d3950e6deb307956a6a0/hovercard" href="https://github.com/flutter/flutter/commit/5a58b36e36b8d7aace89d3950e6deb307956a6a0"><tt>5a58b36</tt></a> (3 weeks ago), 2018-03-13 13:20:13 -0700<br> • Engine revision <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/flutter/flutter/commit/e61bb9ac3a3fd789754e2e54220bcfc27076a857/hovercard" href="https://github.com/flutter/flutter/commit/e61bb9ac3a3fd789754e2e54220bcfc27076a857"><tt>e61bb9a</tt></a><br> • Dart version 2.0.0-dev.35.flutter-290c576264</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Oops; flutter has exited unexpectedly. Sending crash report to Google. Crash report sent (report ID: 11ccd05f01dbb253) Unhandled exception: NoSuchMethodError: The method 'run' was called on null. Receiver: null Tried calling: run(Instance(length:2) of '_GrowableList', environment: null, workingDirectory: null) #0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46) #1 runAsync (package:flutter_tools/src/base/process.dart:227) &lt;asynchronous suspension&gt; #2 IOSWorkflow.macDevMode (package:flutter_tools/src/ios/ios_workflow.dart:45) &lt;asynchronous suspension&gt; #3 IOSWorkflow.validate (package:flutter_tools/src/ios/ios_workflow.dart:90) &lt;asynchronous suspension&gt; #4 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:71) #5 Doctor.diagnose (package:flutter_tools/src/doctor.dart:128) &lt;asynchronous suspension&gt; #6 _doctorText.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:237) #7 AppContext._run (package:flutter_tools/src/base/context.dart:76) &lt;asynchronous suspension&gt; #8 AppContext.runInZone.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:66) #9 _rootRun (dart:async/zone.dart:1126) #10 _CustomZone.run (dart:async/zone.dart:1023) #11 runZoned (dart:async/zone.dart:1501) #12 AppContext.runInZone (package:flutter_tools/src/base/context.dart:65) #13 _doctorText (package:flutter_tools/runner.dart:237) &lt;asynchronous suspension&gt; #14 _createLocalCrashReport (package:flutter_tools/runner.dart:212) &lt;asynchronous suspension&gt; #15 _handleToolError (package:flutter_tools/runner.dart:167) &lt;asynchronous suspension&gt; #16 run.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:94) &lt;asynchronous suspension&gt; #17 AppContext._run (package:flutter_tools/src/base/context.dart:76) &lt;asynchronous suspension&gt; #18 AppContext.runInZone.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:66) #19 _rootRun (dart:async/zone.dart:1126) #20 _CustomZone.run (dart:async/zone.dart:1023) #21 runZoned (dart:async/zone.dart:1501) #22 AppContext.runInZone (package:flutter_tools/src/base/context.dart:65) #23 run (package:flutter_tools/runner.dart:61) &lt;asynchronous suspension&gt; #24 main (package:flutter_tools/executable.dart:48) &lt;asynchronous suspension&gt; #25 main (file:///Users/karllilley/flutter/packages/flutter_tools/bin/flutter_tools.dart:16) #26 _startIsolate.&lt;anonymous closure&gt; (dart:isolate-patch/dart:isolate/isolate_patch.dart:277) #27 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)"><pre class="notranslate"><code class="notranslate">Oops; flutter has exited unexpectedly. Sending crash report to Google. Crash report sent (report ID: 11ccd05f01dbb253) Unhandled exception: NoSuchMethodError: The method 'run' was called on null. Receiver: null Tried calling: run(Instance(length:2) of '_GrowableList', environment: null, workingDirectory: null) #0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46) #1 runAsync (package:flutter_tools/src/base/process.dart:227) &lt;asynchronous suspension&gt; #2 IOSWorkflow.macDevMode (package:flutter_tools/src/ios/ios_workflow.dart:45) &lt;asynchronous suspension&gt; #3 IOSWorkflow.validate (package:flutter_tools/src/ios/ios_workflow.dart:90) &lt;asynchronous suspension&gt; #4 Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:71) #5 Doctor.diagnose (package:flutter_tools/src/doctor.dart:128) &lt;asynchronous suspension&gt; #6 _doctorText.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:237) #7 AppContext._run (package:flutter_tools/src/base/context.dart:76) &lt;asynchronous suspension&gt; #8 AppContext.runInZone.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:66) #9 _rootRun (dart:async/zone.dart:1126) #10 _CustomZone.run (dart:async/zone.dart:1023) #11 runZoned (dart:async/zone.dart:1501) #12 AppContext.runInZone (package:flutter_tools/src/base/context.dart:65) #13 _doctorText (package:flutter_tools/runner.dart:237) &lt;asynchronous suspension&gt; #14 _createLocalCrashReport (package:flutter_tools/runner.dart:212) &lt;asynchronous suspension&gt; #15 _handleToolError (package:flutter_tools/runner.dart:167) &lt;asynchronous suspension&gt; #16 run.&lt;anonymous closure&gt; (package:flutter_tools/runner.dart:94) &lt;asynchronous suspension&gt; #17 AppContext._run (package:flutter_tools/src/base/context.dart:76) &lt;asynchronous suspension&gt; #18 AppContext.runInZone.&lt;anonymous closure&gt; (package:flutter_tools/src/base/context.dart:66) #19 _rootRun (dart:async/zone.dart:1126) #20 _CustomZone.run (dart:async/zone.dart:1023) #21 runZoned (dart:async/zone.dart:1501) #22 AppContext.runInZone (package:flutter_tools/src/base/context.dart:65) #23 run (package:flutter_tools/runner.dart:61) &lt;asynchronous suspension&gt; #24 main (package:flutter_tools/executable.dart:48) &lt;asynchronous suspension&gt; #25 main (file:///Users/karllilley/flutter/packages/flutter_tools/bin/flutter_tools.dart:16) #26 _startIsolate.&lt;anonymous closure&gt; (dart:isolate-patch/dart:isolate/isolate_patch.dart:277) #27 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165) </code></pre></div>
<p dir="auto">Our console output when running xCode builds is very noisy and hard to read. We heard very good things about <a href="https://github.com/supermarin/xcpretty">https://github.com/supermarin/xcpretty</a> from another team that runs xCode builds, so would be good to give that a try for Flutter.</p>
0
<h3 dir="auto">Website or app</h3> <p dir="auto"><a href="https://github.com/TheRitual/ByHeart">https://github.com/TheRitual/ByHeart</a></p> <h3 dir="auto">Repro steps</h3> <p dir="auto">Accualy this bug appears only on React Native debugger. The web version of debugger doesn't show any errors. The project is new and i just installed packages</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ expo install react-navigation $ expo install react-navigation-stack $ expo install expo-app-loading $ expo install react-native-screens $ expo install react-native-safe-area-context"><pre class="notranslate"><code class="notranslate">$ expo install react-navigation $ expo install react-navigation-stack $ expo install expo-app-loading $ expo install react-native-screens $ expo install react-native-safe-area-context </code></pre></div> <p dir="auto">so my dependencies are:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;dependencies&quot;: { &quot;expo&quot;: &quot;~43.0.2&quot;, &quot;expo-status-bar&quot;: &quot;~1.1.0&quot;, &quot;react&quot;: &quot;17.0.1&quot;, &quot;react-dom&quot;: &quot;17.0.1&quot;, &quot;react-native&quot;: &quot;0.64.3&quot;, &quot;react-native-web&quot;: &quot;0.17.1&quot;, &quot;react-navigation&quot;: &quot;^4.4.4&quot;, &quot;react-navigation-stack&quot;: &quot;^2.10.4&quot;, &quot;expo-app-loading&quot;: &quot;~1.2.1&quot;, &quot;react-native-screens&quot;: &quot;~3.8.0&quot;, &quot;react-native-safe-area-context&quot;: &quot;3.3.2&quot; },"><pre class="notranslate"><span class="pl-ent">"dependencies"</span>: { <span class="pl-ent">"expo"</span>: <span class="pl-s"><span class="pl-pds">"</span>~43.0.2<span class="pl-pds">"</span></span>, <span class="pl-ent">"expo-status-bar"</span>: <span class="pl-s"><span class="pl-pds">"</span>~1.1.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"react"</span>: <span class="pl-s"><span class="pl-pds">"</span>17.0.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-dom"</span>: <span class="pl-s"><span class="pl-pds">"</span>17.0.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-native"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.64.3<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-native-web"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.17.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-navigation"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.4.4<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-navigation-stack"</span>: <span class="pl-s"><span class="pl-pds">"</span>^2.10.4<span class="pl-pds">"</span></span>, <span class="pl-ent">"expo-app-loading"</span>: <span class="pl-s"><span class="pl-pds">"</span>~1.2.1<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-native-screens"</span>: <span class="pl-s"><span class="pl-pds">"</span>~3.8.0<span class="pl-pds">"</span></span>, <span class="pl-ent">"react-native-safe-area-context"</span>: <span class="pl-s"><span class="pl-pds">"</span>3.3.2<span class="pl-pds">"</span></span> },</pre></div> <p dir="auto">I checked and now this bug appears in every new expo init even if it is just blank project. Old projects work fine.</p> <h3 dir="auto">How often does this bug happen?</h3> <p dir="auto">Every time</p> <h3 dir="auto">DevTools package (automated)</h3> <p dir="auto">react-devtools-core</p> <h3 dir="auto">DevTools version (automated)</h3> <p dir="auto">4.14.0-d0ec283819</p> <h3 dir="auto">Error message (automated)</h3> <p dir="auto">Cannot add node "1" because a node with that id is already in the Store.</p> <h3 dir="auto">Error call stack (automated)</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="at C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:140545 at c.emit (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:89515) at C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:90986 at C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:347787 at Array.forEach (&lt;anonymous&gt;) at S.Gc.e.onmessage (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:347771) at S.n (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:40:3009) at S.emit (events.js:315:20) at e.exports.P (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:9318) at e.exports.emit (events.js:315:20) at e.exports.dataMessage (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:15409) at e.exports.getData (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:14651) at e.exports.startLoop (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:12066) at e.exports._write (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:11421) at doWrite (_stream_writable.js:403:12) at writeOrBuffer (_stream_writable.js:387:5)"><pre lang="text" class="notranslate"><code class="notranslate">at C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:140545 at c.emit (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:89515) at C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:90986 at C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:347787 at Array.forEach (&lt;anonymous&gt;) at S.Gc.e.onmessage (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:48:347771) at S.n (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:40:3009) at S.emit (events.js:315:20) at e.exports.P (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:9318) at e.exports.emit (events.js:315:20) at e.exports.dataMessage (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:15409) at e.exports.getData (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:14651) at e.exports.startLoop (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:12066) at e.exports._write (C:\Users\Ritual\AppData\Local\react_native_debugger\app-0.12.1\resources\app.asar\node_modules\react-devtools-core\dist\standalone.js:8:11421) at doWrite (_stream_writable.js:403:12) at writeOrBuffer (_stream_writable.js:387:5) </code></pre></div> <h3 dir="auto">Error component stack (automated)</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">GitHub query string (automated)</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="https://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:&quot;Component: Developer Tools&quot; repo:facebook/react"><pre lang="text" class="notranslate"><code class="notranslate">https://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react </code></pre></div>
<h3 dir="auto">Website or app</h3> <p dir="auto"><a href="https://zhivika.ru/product/26406103_plastyr_perc_bperf_10smh18sm_n" rel="nofollow">https://zhivika.ru/product/26406103_plastyr_perc_bperf_10smh18sm_n</a></p> <h3 dir="auto">Repro steps</h3> <ol dir="auto"> <li>Load page.</li> <li>Open react components.</li> <li>Click button "Смотреть все аптеки" for unfold all list.</li> </ol> <h3 dir="auto">How often does this bug happen?</h3> <p dir="auto">Every time</p> <h3 dir="auto">DevTools package (automated)</h3> <p dir="auto">react-devtools-extensions</p> <h3 dir="auto">DevTools version (automated)</h3> <p dir="auto">4.13.5-0ae5290b54</p> <h3 dir="auto">Error message (automated)</h3> <p dir="auto">Cannot add node "476" because a node with that id is already in the Store.</p> <h3 dir="auto">Error call stack (automated)</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Error component stack (automated)</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">GitHub query string (automated)</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="https://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:&quot;Component: Developer Tools&quot; repo:facebook/react"><pre lang="text" class="notranslate"><code class="notranslate">https://api.github.com/search/issues?q=Cannot add node because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react </code></pre></div>
1
<h5 dir="auto">ISSUE TYPE</h5> <ul dir="auto"> <li>Feature Idea</li> </ul> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">elasticache</p> <h5 dir="auto">ANSIBLE VERSION</h5> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0 config file = /home/lyle/projects/prima_cm/ansible.cfg configured module search path = Default w/o overrides python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0 config file = /home/lyle/projects/prima_cm/ansible.cfg configured module search path = Default w/o overrides python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2] </code></pre></div> <h5 dir="auto">CONFIGURATION</h5> <p dir="auto">N/A</p> <h5 dir="auto">OS / ENVIRONMENT</h5> <p dir="auto">N/A</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">If I want to have duplicate environments for staging and production, it's easy to distinguish them when grouping by tags. I also want to provision AWS with Ansible, but the elasticache module does not have a <code class="notranslate">tags</code> parameter.</p>
<h5 dir="auto">ISSUE TYPE</h5> <p dir="auto">Bug Report</p> <h5 dir="auto">COMPONENT NAME</h5> <p dir="auto">ec2_asg module</p> <h5 dir="auto">ANSIBLE VERSION</h5> <p dir="auto">1.9</p> <h5 dir="auto">SUMMARY</h5> <p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ferrants/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ferrants">@ferrants</a> on 2015-07-30T19:08:37Z<br> Experienced with <code class="notranslate">stable-1.9</code>.</p> <p dir="auto">Desired size is incremented by the batch size. The old instances are marked as unhealthy. As the old instance is terminated, a new instance is created to match the desired size. Once the old instance is terminated and all new instances are healthy, the size is decreased, terminating undesired instance.</p> <p dir="auto">With a batch size of 1 and desired size of one, the flow is as follows:</p> <ul dir="auto"> <li>starts with one old instance, desired is 1</li> <li>gets one new instance, desired is 2</li> <li>old instance starts being torn down, gets another new instance, desired is 2</li> <li>one of the new instances is torn down when desired capacity is reduced to 1</li> </ul> <p dir="auto">Activity history is attached:<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/882183/8992509/d50739aa-36cc-11e5-9681-eb4c47615636.png"><img width="1207" alt="screen shot 2015-07-30 at 3 08 09 pm" src="https://cloud.githubusercontent.com/assets/882183/8992509/d50739aa-36cc-11e5-9681-eb4c47615636.png" style="max-width: 100%;"></a></p> <p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98240801" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/1845" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/1845/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/1845">ansible/ansible-modules-core#1845</a></p>
0
<p dir="auto">Hello,</p> <p dir="auto">When i run this simple portion of code</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" import numpy as np from scipy.spatial import SphericalVoronoi, distance from scipy.spatial import _spherical_voronoi as spherical_voronoi test = np.array([[-0.1382177 , -0.66701253, 0.36649207], [-0.33718559, -0.0515926 , 0.7109696 ], [-0.13633904, -0.65712506, 0.3830903 ], [ 0.04510981, 0.72285262, 0.35677763], [-0.14008791, -0.65997704, 0.37445958], [-0.7253343 , -0.26837762, 0.00655405], [-0.58085674, -0.40511863, -0.36093304], [ 0.2780397 , 0.72729778, 0.24511902], [-0.33315233, -0.16453994, -0.6972229 ], [-0.46532148, 0.35901168, -0.45935981], [-0.72827086, -0.25884677, -0.00137087], [-0.72758263, -0.25989862, 0.00278446], [-0.70204518, -0.31395337, -0.0467136 ], [-0.71771464, -0.28226784, -0.01436788], [-0.72884793, -0.25239507, 0.01278218], [-0.72528059, -0.26018933, -0.00931674], [ 0.23175783, -0.68754004, 0.24004559], [ 0.69090723, -0.2371959 , -0.19492292], [ 0.40653046, -0.63173528, -0.25505239], [ 0.53203067, -0.52945865, -0.14520801], [ 0.52527016, -0.53501648, -0.2155609 ], [ 0.56226738, -0.31942141, -0.39975375]]) sv = SphericalVoronoi(test) sv.sort_vertices_of_regions()"><pre class="notranslate"><code class="notranslate"> import numpy as np from scipy.spatial import SphericalVoronoi, distance from scipy.spatial import _spherical_voronoi as spherical_voronoi test = np.array([[-0.1382177 , -0.66701253, 0.36649207], [-0.33718559, -0.0515926 , 0.7109696 ], [-0.13633904, -0.65712506, 0.3830903 ], [ 0.04510981, 0.72285262, 0.35677763], [-0.14008791, -0.65997704, 0.37445958], [-0.7253343 , -0.26837762, 0.00655405], [-0.58085674, -0.40511863, -0.36093304], [ 0.2780397 , 0.72729778, 0.24511902], [-0.33315233, -0.16453994, -0.6972229 ], [-0.46532148, 0.35901168, -0.45935981], [-0.72827086, -0.25884677, -0.00137087], [-0.72758263, -0.25989862, 0.00278446], [-0.70204518, -0.31395337, -0.0467136 ], [-0.71771464, -0.28226784, -0.01436788], [-0.72884793, -0.25239507, 0.01278218], [-0.72528059, -0.26018933, -0.00931674], [ 0.23175783, -0.68754004, 0.24004559], [ 0.69090723, -0.2371959 , -0.19492292], [ 0.40653046, -0.63173528, -0.25505239], [ 0.53203067, -0.52945865, -0.14520801], [ 0.52527016, -0.53501648, -0.2155609 ], [ 0.56226738, -0.31942141, -0.39975375]]) sv = SphericalVoronoi(test) sv.sort_vertices_of_regions() </code></pre></div> <p dir="auto">I get the following error :</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org &gt;&gt;&gt; import numpy as np &gt;&gt;&gt; from scipy.spatial import SphericalVoronoi, distance &gt;&gt;&gt; from scipy.spatial import _spherical_voronoi as spherical_voronoi &gt;&gt;&gt; &gt;&gt;&gt; test = np.array([[-0.1382177 , -0.66701253, 0.36649207], ... [-0.33718559, -0.0515926 , 0.7109696 ], ... [-0.13633904, -0.65712506, 0.3830903 ], ... [ 0.04510981, 0.72285262, 0.35677763], ... [-0.14008791, -0.65997704, 0.37445958], ... [-0.7253343 , -0.26837762, 0.00655405], ... [-0.58085674, -0.40511863, -0.36093304], ... [ 0.2780397 , 0.72729778, 0.24511902], ... [-0.33315233, -0.16453994, -0.6972229 ], ... [-0.46532148, 0.35901168, -0.45935981], ... [-0.72827086, -0.25884677, -0.00137087], ... [-0.72758263, -0.25989862, 0.00278446], ... [-0.70204518, -0.31395337, -0.0467136 ], ... [-0.71771464, -0.28226784, -0.01436788], ... [-0.72884793, -0.25239507, 0.01278218], ... [-0.72528059, -0.26018933, -0.00931674], ... [ 0.23175783, -0.68754004, 0.24004559], ... [ 0.69090723, -0.2371959 , -0.19492292], ... [ 0.40653046, -0.63173528, -0.25505239], ... [ 0.53203067, -0.52945865, -0.14520801], ... [ 0.52527016, -0.53501648, -0.2155609 ], ... [ 0.56226738, -0.31942141, -0.39975375]]) &gt;&gt;&gt; &gt;&gt;&gt; sv = SphericalVoronoi(test) &gt;&gt;&gt; sv.sort_vertices_of_regions() Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;/env/export/cns_n02_agc/agc/home/ggautrea/anaconda2/lib/python2.7/site-packages/scipy/spatial/_spherical_voronoi.py&quot;, line 319, in sort_vertices_of_regions ][0] IndexError: list index out of range"><pre class="notranslate"><code class="notranslate">Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. Anaconda is brought to you by Continuum Analytics. Please check out: http://continuum.io/thanks and https://anaconda.org &gt;&gt;&gt; import numpy as np &gt;&gt;&gt; from scipy.spatial import SphericalVoronoi, distance &gt;&gt;&gt; from scipy.spatial import _spherical_voronoi as spherical_voronoi &gt;&gt;&gt; &gt;&gt;&gt; test = np.array([[-0.1382177 , -0.66701253, 0.36649207], ... [-0.33718559, -0.0515926 , 0.7109696 ], ... [-0.13633904, -0.65712506, 0.3830903 ], ... [ 0.04510981, 0.72285262, 0.35677763], ... [-0.14008791, -0.65997704, 0.37445958], ... [-0.7253343 , -0.26837762, 0.00655405], ... [-0.58085674, -0.40511863, -0.36093304], ... [ 0.2780397 , 0.72729778, 0.24511902], ... [-0.33315233, -0.16453994, -0.6972229 ], ... [-0.46532148, 0.35901168, -0.45935981], ... [-0.72827086, -0.25884677, -0.00137087], ... [-0.72758263, -0.25989862, 0.00278446], ... [-0.70204518, -0.31395337, -0.0467136 ], ... [-0.71771464, -0.28226784, -0.01436788], ... [-0.72884793, -0.25239507, 0.01278218], ... [-0.72528059, -0.26018933, -0.00931674], ... [ 0.23175783, -0.68754004, 0.24004559], ... [ 0.69090723, -0.2371959 , -0.19492292], ... [ 0.40653046, -0.63173528, -0.25505239], ... [ 0.53203067, -0.52945865, -0.14520801], ... [ 0.52527016, -0.53501648, -0.2155609 ], ... [ 0.56226738, -0.31942141, -0.39975375]]) &gt;&gt;&gt; &gt;&gt;&gt; sv = SphericalVoronoi(test) &gt;&gt;&gt; sv.sort_vertices_of_regions() Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/env/export/cns_n02_agc/agc/home/ggautrea/anaconda2/lib/python2.7/site-packages/scipy/spatial/_spherical_voronoi.py", line 319, in sort_vertices_of_regions ][0] IndexError: list index out of range </code></pre></div> <p dir="auto">I use scipy 0.18.1.<br> Can you help me ?</p> <p dir="auto">Thank you.</p>
<p dir="auto">Hi all,</p> <p dir="auto">It seems nquad has a memory leak when integrating a function implemented using ctypes. Here is the code that can be used to replicate this issue:</p> <p dir="auto">Save this as testlib.c:</p> <p dir="auto"><code class="notranslate">//testlib.c</code><br> <code class="notranslate"># include &lt;math.h&gt;</code><br> <code class="notranslate">double f(int n, double args[n]){</code><br> <code class="notranslate">return pow(args[0], 2) - exp(args[1]) * args[2]; //corresponds to x0 - x1 * x2</code><br> <code class="notranslate">}</code></p> <p dir="auto">Compile the function:</p> <p dir="auto"><code class="notranslate">gcc -shared -o testlib.so -fPIC testlib.c</code></p> <p dir="auto">Run this in Python:</p> <p dir="auto"><code class="notranslate">import ctypes</code><br> <code class="notranslate">from scipy import integrate</code></p> <p dir="auto"><code class="notranslate">lib = ctypes.CDLL('./testlib.so')</code><br> <code class="notranslate">func = lib.f</code><br> <code class="notranslate">func.restype = ctypes.c_double</code><br> <code class="notranslate">func.argtypes = (ctypes.c_int, ctypes.c_double)</code></p> <p dir="auto"><code class="notranslate">while True:</code><br> <code class="notranslate">integrate.nquad(func, [[0, 10], [-10, 0], [-1, 1]])</code></p> <p dir="auto">and use "top" to watch how the memory usage grows.</p> <p dir="auto">Any chance for a quick fix?</p> <p dir="auto">Cheers,</p> <p dir="auto">Brani</p>
0
<p dir="auto"><a href="https://gist.github.com/iugo/1dde0cb200e57f64df71c31ca0400b16">https://gist.github.com/iugo/1dde0cb200e57f64df71c31ca0400b16</a></p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// main.ts import { blue } from 'colors'; console.log(blue('hehe')); // deno compile --output=bin -c deno.json main.ts // ./bin (error, lost import map) // deno compile --output=bin --import-map import_map.json main.ts // ./bin (works!)"><pre class="notranslate"><span class="pl-c">// main.ts</span> <span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">blue</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'colors'</span><span class="pl-kos">;</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-en">blue</span><span class="pl-kos">(</span><span class="pl-s">'hehe'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// deno compile --output=bin -c deno.json main.ts</span> <span class="pl-c">// ./bin (error, lost import map)</span> <span class="pl-c">// deno compile --output=bin --import-map import_map.json main.ts</span> <span class="pl-c">// ./bin (works!)</span></pre></div> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// deno.json { &quot;compilerOptions&quot;: { &quot;strict&quot;: true }, &quot;importMap&quot;: &quot;./import_map.json&quot; }"><pre class="notranslate"><span class="pl-c">// deno.json</span> <span class="pl-kos">{</span> <span class="pl-s">"compilerOptions"</span>: <span class="pl-kos">{</span> <span class="pl-s">"strict"</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">"importMap"</span>: <span class="pl-s">"./import_map.json"</span> <span class="pl-kos">}</span></pre></div> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// import_map.json { &quot;imports&quot;: { &quot;colors&quot;: &quot;https://deno.land/[email protected]/fmt/colors.ts&quot; } }"><pre class="notranslate"><span class="pl-c">// import_map.json</span> <span class="pl-kos">{</span> <span class="pl-s">"imports"</span>: <span class="pl-kos">{</span> <span class="pl-s">"colors"</span>: <span class="pl-s">"https://deno.land/[email protected]/fmt/colors.ts"</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p dir="auto">deno version: 1.28.3</p>
<p dir="auto">Hey! I have a smallish project that I'm working on, and when I compile the command to make a binary, it seems to ignore the <code class="notranslate">import_map.json</code>. I have an <code class="notranslate">"importMap"</code> key in my <code class="notranslate">deno.json</code>, but it doesn't pick it up. When I use <code class="notranslate">--import-map ./import_map.json</code> it works, but it then gives me a warning that the <code class="notranslate">"importMap"</code> key is being ignored. It also works completely fine when I run with <code class="notranslate">deno run</code>, and I don't have to use the <code class="notranslate">--import-map</code> option.</p> <p dir="auto">Here are the commands I used:</p> <p dir="auto">Compile: <code class="notranslate">deno compile --allow-env --allow-net --allow-read ./src/main.ts</code><br> The compilation succeeds, but when I try to run the binary with <code class="notranslate">./main</code> I get this result: <code class="notranslate">error: Relative import path "dotenv/mod.ts" not prefixed with / or ./ or ../ from "file:///home/redxtech/Code/project/src/main.ts"</code></p> <p dir="auto">Compile with args: <code class="notranslate">deno compile --allow-env --allow-net --allow-read --import-map ./import_map.json ./src/main.ts</code><br> Warning: <code class="notranslate">Warning the configuration file "file:///home/redxtech/Code/project/deno.json" contains an entry for "importMap" that is being ignored.</code></p> <p dir="auto">Run: <code class="notranslate">deno run --allow-env --allow-net --allow-read ./src/main.ts</code><br> Result: works as expected.</p> <p dir="auto">Output of <code class="notranslate">deno --version</code>:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno 1.20.5 (release, x86_64-unknown-linux-gnu) v8 10.0.139.6 typescript 4.6.2"><pre class="notranslate"><code class="notranslate">deno 1.20.5 (release, x86_64-unknown-linux-gnu) v8 10.0.139.6 typescript 4.6.2 </code></pre></div> <p dir="auto">Here's my <code class="notranslate">./deno.json</code> (<code class="notranslate">lint</code> &amp; <code class="notranslate">fmt</code> fields removed):</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;compilerOptions&quot;: { &quot;allowJs&quot;: false, &quot;lib&quot;: [&quot;deno.window&quot;, &quot;es2021&quot;], &quot;noUnusedLocals&quot;: true, &quot;noUnusedParameters&quot;: true, &quot;strict&quot;: true }, &quot;importMap&quot;: &quot;./import_map.json&quot; }"><pre class="notranslate">{ <span class="pl-ent">"compilerOptions"</span>: { <span class="pl-ent">"allowJs"</span>: <span class="pl-c1">false</span>, <span class="pl-ent">"lib"</span>: [<span class="pl-s"><span class="pl-pds">"</span>deno.window<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>es2021<span class="pl-pds">"</span></span>], <span class="pl-ent">"noUnusedLocals"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"noUnusedParameters"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"strict"</span>: <span class="pl-c1">true</span> }, <span class="pl-ent">"importMap"</span>: <span class="pl-s"><span class="pl-pds">"</span>./import_map.json<span class="pl-pds">"</span></span> }</pre></div> <p dir="auto">and my <code class="notranslate">./import_map.json</code>:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;imports&quot;: { &quot;dotenv/&quot;: &quot;https://deno.land/x/[email protected]/&quot;, &quot;kall/&quot;: &quot;https://denopkg.com/olaven/[email protected]/&quot;, &quot;std/&quot;: &quot;https://deno.land/[email protected]/&quot; } } "><pre class="notranslate">{ <span class="pl-ent">"imports"</span>: { <span class="pl-ent">"dotenv/"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://deno.land/x/[email protected]/<span class="pl-pds">"</span></span>, <span class="pl-ent">"kall/"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://denopkg.com/olaven/[email protected]/<span class="pl-pds">"</span></span>, <span class="pl-ent">"std/"</span>: <span class="pl-s"><span class="pl-pds">"</span>https://deno.land/[email protected]/<span class="pl-pds">"</span></span> } } </pre></div> <p dir="auto">Here's the relevant part of <code class="notranslate">./src/main.ts</code> file where the imports are used:</p> <div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { config as dotEnvConfig } from 'dotenv/mod.ts';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">config</span> <span class="pl-k">as</span> <span class="pl-s1">dotEnvConfig</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'dotenv/mod.ts'</span><span class="pl-kos">;</span></pre></div> <p dir="auto">If you need any more info I would be happy to provide it.</p>
1
<p dir="auto">Using npm install do download dependencies, should be fairly straight forward.</p> <p dir="auto">complete log shown below.</p> <p dir="auto">0 info it worked if it ends with ok<br> 1 verbose cli [ 'C:\Program Files\nodejs\node.exe',<br> 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',<br> 1 verbose cli 'install' ]<br> 2 info using [email protected]<br> 3 info using [email protected]<br> 4 verbose npm-session aa552116e7cfd9b1<br> 5 silly install runPreinstallTopLevelLifecycles<br> 6 silly preinstall [email protected]<br> 7 info lifecycle [email protected]~preinstall: [email protected]<br> 8 silly install loadCurrentTree<br> 9 silly install readLocalPackageData<br> 10 silly install loadIdealTree<br> 11 silly install cloneCurrentTreeToIdealTree<br> 12 silly install loadShrinkwrap<br> 13 silly install loadAllDepsIntoIdealTree<br> 14 http fetch GET 200 <a href="https://registry.npmjs.org/bcryptjs" rel="nofollow">https://registry.npmjs.org/bcryptjs</a> 97ms (from cache)<br> 15 silly pacote range manifest for bcryptjs@^2.4.3 fetched in 103ms<br> 16 http fetch GET 304 <a href="https://registry.npmjs.org/nodemon" rel="nofollow">https://registry.npmjs.org/nodemon</a> 305ms (from cache)<br> 17 silly pacote range manifest for nodemon@^1.17.3 fetched in 413ms<br> 18 http fetch GET 304 <a href="https://registry.npmjs.org/body-parser" rel="nofollow">https://registry.npmjs.org/body-parser</a> 342ms (from cache)<br> 19 http fetch GET 304 <a href="https://registry.npmjs.org/passport-jwt" rel="nofollow">https://registry.npmjs.org/passport-jwt</a> 343ms (from cache)<br> 20 http fetch GET 304 <a href="https://registry.npmjs.org/concurrently" rel="nofollow">https://registry.npmjs.org/concurrently</a> 353ms (from cache)<br> 21 silly pacote range manifest for body-parser@^1.18.2 fetched in 357ms<br> 22 http fetch GET 304 <a href="https://registry.npmjs.org/passport" rel="nofollow">https://registry.npmjs.org/passport</a> 354ms (from cache)<br> 23 http fetch GET 304 <a href="https://registry.npmjs.org/jsonwebtoken" rel="nofollow">https://registry.npmjs.org/jsonwebtoken</a> 356ms (from cache)<br> 24 http fetch GET 304 <a href="https://registry.npmjs.org/express" rel="nofollow">https://registry.npmjs.org/express</a> 359ms (from cache)<br> 25 silly pacote range manifest for passport-jwt@^4.0.0 fetched in 375ms<br> 26 http fetch GET 304 <a href="https://registry.npmjs.org/gravatar" rel="nofollow">https://registry.npmjs.org/gravatar</a> 377ms (from cache)<br> 27 http fetch GET 304 <a href="https://registry.npmjs.org/validator" rel="nofollow">https://registry.npmjs.org/validator</a> 281ms (from cache)<br> 28 silly pacote range manifest for passport@^0.4.0 fetched in 389ms<br> 29 silly pacote range manifest for jsonwebtoken@^8.2.0 fetched in 395ms<br> 30 silly pacote range manifest for express@^4.16.3 fetched in 398ms<br> 31 silly pacote range manifest for gravatar@^1.6.0 fetched in 411ms<br> 32 silly pacote range manifest for validator@^9.4.1 fetched in 321ms<br> 33 http fetch GET 304 <a href="https://registry.npmjs.org/mongoose" rel="nofollow">https://registry.npmjs.org/mongoose</a> 439ms (from cache)<br> 34 http fetch GET 200 <a href="https://registry.npmjs.org/concurrently/-/concurrently-3.6.1.tgz" rel="nofollow">https://registry.npmjs.org/concurrently/-/concurrently-3.6.1.tgz</a> 84ms (from cache)<br> 35 silly pacote range manifest for mongoose@^5.0.12 fetched in 472ms<br> 36 http fetch GET 200 <a href="https://registry.npmjs.org/semver" rel="nofollow">https://registry.npmjs.org/semver</a> 73ms (from cache)<br> 37 silly pacote range manifest for semver@^5.7.1 fetched in 88ms<br> 38 http fetch GET 304 <a href="https://registry.npmjs.org/chokidar" rel="nofollow">https://registry.npmjs.org/chokidar</a> 172ms (from cache)<br> 39 silly pacote range manifest for chokidar@^2.1.8 fetched in 183ms<br> 40 http fetch GET 304 <a href="https://registry.npmjs.org/ignore-by-default" rel="nofollow">https://registry.npmjs.org/ignore-by-default</a> 155ms (from cache)<br> 41 http fetch GET 304 <a href="https://registry.npmjs.org/debug" rel="nofollow">https://registry.npmjs.org/debug</a> 171ms (from cache)<br> 42 http fetch GET 304 <a href="https://registry.npmjs.org/pstree.remy" rel="nofollow">https://registry.npmjs.org/pstree.remy</a> 152ms (from cache)<br> 43 http fetch GET 304 <a href="https://registry.npmjs.org/minimatch" rel="nofollow">https://registry.npmjs.org/minimatch</a> 160ms (from cache)<br> 44 silly pacote range manifest for ignore-by-default@^1.0.1 fetched in 177ms<br> 45 silly pacote range manifest for debug@^3.2.6 fetched in 204ms<br> 46 http fetch GET 304 <a href="https://registry.npmjs.org/supports-color" rel="nofollow">https://registry.npmjs.org/supports-color</a> 159ms (from cache)<br> 47 silly pacote range manifest for pstree.remy@^1.1.7 fetched in 172ms<br> 48 silly pacote range manifest for minimatch@^3.0.4 fetched in 180ms<br> 49 silly pacote version manifest for [email protected] fetched in 14ms<br> 50 silly pacote range manifest for supports-color@^5.5.0 fetched in 177ms<br> 51 http fetch GET 200 <a href="https://registry.npmjs.org/depd" rel="nofollow">https://registry.npmjs.org/depd</a> 40ms (from cache)<br> 52 silly pacote range manifest for depd@~1.1.2 fetched in 54ms<br> 53 http fetch GET 304 <a href="https://registry.npmjs.org/touch" rel="nofollow">https://registry.npmjs.org/touch</a> 210ms (from cache)<br> 54 http fetch GET 304 <a href="https://registry.npmjs.org/undefsafe" rel="nofollow">https://registry.npmjs.org/undefsafe</a> 169ms (from cache)<br> 55 silly pacote range manifest for touch@^3.1.0 fetched in 226ms<br> 56 http fetch GET 304 <a href="https://registry.npmjs.org/update-notifier" rel="nofollow">https://registry.npmjs.org/update-notifier</a> 168ms (from cache)<br> 57 silly pacote range manifest for undefsafe@^2.0.2 fetched in 186ms<br> 58 silly pacote range manifest for update-notifier@^2.5.0 fetched in 190ms<br> 59 http fetch GET 304 <a href="https://registry.npmjs.org/bytes" rel="nofollow">https://registry.npmjs.org/bytes</a> 165ms (from cache)<br> 60 silly pacote version manifest for [email protected] fetched in 180ms<br> 61 http fetch GET 304 <a href="https://registry.npmjs.org/content-type" rel="nofollow">https://registry.npmjs.org/content-type</a> 151ms (from cache)<br> 62 http fetch GET 304 <a href="https://registry.npmjs.org/http-errors" rel="nofollow">https://registry.npmjs.org/http-errors</a> 142ms (from cache)<br> 63 silly pacote range manifest for content-type@~1.0.4 fetched in 161ms<br> 64 http fetch GET 304 <a href="https://registry.npmjs.org/iconv-lite" rel="nofollow">https://registry.npmjs.org/iconv-lite</a> 141ms (from cache)<br> 65 silly pacote version manifest for [email protected] fetched in 153ms<br> 66 silly pacote version manifest for [email protected] fetched in 170ms<br> 67 http fetch GET 304 <a href="https://registry.npmjs.org/on-finished" rel="nofollow">https://registry.npmjs.org/on-finished</a> 159ms (from cache)<br> 68 http fetch GET 304 <a href="https://registry.npmjs.org/qs" rel="nofollow">https://registry.npmjs.org/qs</a> 131ms (from cache)<br> 69 silly pacote range manifest for on-finished@~2.3.0 fetched in 173ms<br> 70 silly pacote version manifest for [email protected] fetched in 147ms<br> 71 http fetch GET 304 <a href="https://registry.npmjs.org/raw-body" rel="nofollow">https://registry.npmjs.org/raw-body</a> 152ms (from cache)<br> 72 silly pacote version manifest for [email protected] fetched in 169ms<br> 73 http fetch GET 304 <a href="https://registry.npmjs.org/type-is" rel="nofollow">https://registry.npmjs.org/type-is</a> 162ms (from cache)<br> 74 http fetch GET 304 <a href="https://registry.npmjs.org/passport-strategy" rel="nofollow">https://registry.npmjs.org/passport-strategy</a> 152ms (from cache)<br> 75 http fetch GET 304 <a href="https://registry.npmjs.org/passport-strategy" rel="nofollow">https://registry.npmjs.org/passport-strategy</a> 140ms (from cache)<br> 76 silly pacote range manifest for type-is@~1.6.17 fetched in 181ms<br> 77 silly pacote range manifest for passport-strategy@^1.0.0 fetched in 167ms<br> 78 silly pacote range manifest for <a href="mailto:[email protected]">[email protected]</a> fetched in 153ms<br> 79 http fetch GET 304 <a href="https://registry.npmjs.org/pause" rel="nofollow">https://registry.npmjs.org/pause</a> 142ms (from cache)<br> 80 http fetch GET 304 <a href="https://registry.npmjs.org/jws" rel="nofollow">https://registry.npmjs.org/jws</a> 135ms (from cache)<br> 81 http fetch GET 200 <a href="https://registry.npmjs.org/lodash.once" rel="nofollow">https://registry.npmjs.org/lodash.once</a> 14ms (from cache)<br> 82 silly pacote version manifest for [email protected] fetched in 146ms<br> 83 http fetch GET 304 <a href="https://registry.npmjs.org/lodash.includes" rel="nofollow">https://registry.npmjs.org/lodash.includes</a> 116ms (from cache)<br> 84 silly pacote range manifest for jws@^3.2.2 fetched in 141ms<br> 85 silly pacote range manifest for lodash.once@^4.0.0 fetched in 23ms<br> 86 http fetch GET 304 <a href="https://registry.npmjs.org/lodash.isboolean" rel="nofollow">https://registry.npmjs.org/lodash.isboolean</a> 109ms (from cache)<br> 87 silly pacote range manifest for lodash.includes@^4.3.0 fetched in 128ms<br> 88 silly pacote range manifest for semver@^5.6.0 fetched in 13ms<br> 89 silly pacote range manifest for lodash.isboolean@^3.0.3 fetched in 118ms<br> 90 http fetch GET 304 <a href="https://registry.npmjs.org/lodash.isinteger" rel="nofollow">https://registry.npmjs.org/lodash.isinteger</a> 112ms (from cache)<br> 91 silly pacote version manifest for [email protected] fetched in 5ms<br> 92 silly pacote range manifest for lodash.isinteger@^4.0.4 fetched in 122ms<br> 93 http fetch GET 200 <a href="https://registry.npmjs.org/cookie" rel="nofollow">https://registry.npmjs.org/cookie</a> 15ms (from cache)<br> 94 silly pacote version manifest for [email protected] fetched in 17ms<br> 95 http fetch GET 304 <a href="https://registry.npmjs.org/lodash.isnumber" rel="nofollow">https://registry.npmjs.org/lodash.isnumber</a> 119ms (from cache)<br> 96 silly pacote range manifest for lodash.isnumber@^3.0.3 fetched in 132ms<br> 97 http fetch GET 304 <a href="https://registry.npmjs.org/ms" rel="nofollow">https://registry.npmjs.org/ms</a> 107ms (from cache)<br> 98 http fetch GET 304 <a href="https://registry.npmjs.org/lodash.isstring" rel="nofollow">https://registry.npmjs.org/lodash.isstring</a> 127ms (from cache)<br> 99 http fetch GET 304 <a href="https://registry.npmjs.org/lodash.isplainobject" rel="nofollow">https://registry.npmjs.org/lodash.isplainobject</a> 134ms (from cache)<br> 100 http fetch GET 304 <a href="https://registry.npmjs.org/accepts" rel="nofollow">https://registry.npmjs.org/accepts</a> 101ms (from cache)<br> 101 silly pacote range manifest for lodash.isstring@^4.0.1 fetched in 134ms<br> 102 silly pacote range manifest for ms@^2.1.1 fetched in 116ms<br> 103 silly pacote range manifest for lodash.isplainobject@^4.0.6 fetched in 140ms<br> 104 silly pacote range manifest for accepts@~1.3.7 fetched in 107ms<br> 105 http fetch GET 304 <a href="https://registry.npmjs.org/array-flatten" rel="nofollow">https://registry.npmjs.org/array-flatten</a> 106ms (from cache)<br> 106 http fetch GET 304 <a href="https://registry.npmjs.org/content-disposition" rel="nofollow">https://registry.npmjs.org/content-disposition</a> 109ms (from cache)<br> 107 http fetch GET 304 <a href="https://registry.npmjs.org/cookie-signature" rel="nofollow">https://registry.npmjs.org/cookie-signature</a> 99ms (from cache)<br> 108 silly pacote version manifest for [email protected] fetched in 119ms<br> 109 silly pacote version manifest for [email protected] fetched in 117ms<br> 110 http fetch GET 304 <a href="https://registry.npmjs.org/encodeurl" rel="nofollow">https://registry.npmjs.org/encodeurl</a> 96ms (from cache)<br> 111 silly pacote version manifest for [email protected] fetched in 107ms<br> 112 silly pacote range manifest for encodeurl@~1.0.2 fetched in 109ms<br> 113 http fetch GET 304 <a href="https://registry.npmjs.org/escape-html" rel="nofollow">https://registry.npmjs.org/escape-html</a> 124ms (from cache)<br> 114 silly pacote range manifest for escape-html@~1.0.3 fetched in 133ms<br> 115 http fetch GET 304 <a href="https://registry.npmjs.org/etag" rel="nofollow">https://registry.npmjs.org/etag</a> 104ms (from cache)<br> 116 http fetch GET 304 <a href="https://registry.npmjs.org/fresh" rel="nofollow">https://registry.npmjs.org/fresh</a> 104ms (from cache)<br> 117 http fetch GET 304 <a href="https://registry.npmjs.org/merge-descriptors" rel="nofollow">https://registry.npmjs.org/merge-descriptors</a> 104ms (from cache)<br> 118 silly pacote range manifest for etag@~1.8.1 fetched in 115ms<br> 119 silly pacote version manifest for [email protected] fetched in 115ms<br> 120 silly pacote version manifest for [email protected] fetched in 115ms<br> 121 http fetch GET 304 <a href="https://registry.npmjs.org/finalhandler" rel="nofollow">https://registry.npmjs.org/finalhandler</a> 120ms (from cache)<br> 122 http fetch GET 304 <a href="https://registry.npmjs.org/parseurl" rel="nofollow">https://registry.npmjs.org/parseurl</a> 104ms (from cache)<br> 123 silly pacote range manifest for finalhandler@~1.1.2 fetched in 134ms<br> 124 silly pacote range manifest for parseurl@~1.3.3 fetched in 119ms<br> 125 http fetch GET 304 <a href="https://registry.npmjs.org/methods" rel="nofollow">https://registry.npmjs.org/methods</a> 121ms (from cache)<br> 126 http fetch GET 200 <a href="https://registry.npmjs.org/safe-buffer" rel="nofollow">https://registry.npmjs.org/safe-buffer</a> 28ms (from cache)<br> 127 http fetch GET 304 <a href="https://registry.npmjs.org/path-to-regexp" rel="nofollow">https://registry.npmjs.org/path-to-regexp</a> 124ms (from cache)<br> 128 http fetch GET 304 <a href="https://registry.npmjs.org/proxy-addr" rel="nofollow">https://registry.npmjs.org/proxy-addr</a> 112ms (from cache)<br> 129 silly pacote range manifest for methods@~1.1.2 fetched in 136ms<br> 130 silly pacote version manifest for [email protected] fetched in 49ms<br> 131 silly pacote version manifest for [email protected] fetched in 143ms<br> 132 silly pacote range manifest for proxy-addr@~2.0.5 fetched in 129ms<br> 133 silly pacote range manifest for type-is@~1.6.18 fetched in 7ms<br> 134 http fetch GET 304 <a href="https://registry.npmjs.org/range-parser" rel="nofollow">https://registry.npmjs.org/range-parser</a> 104ms (from cache)<br> 135 silly pacote range manifest for range-parser@~1.2.1 fetched in 116ms<br> 136 http fetch GET 304 <a href="https://registry.npmjs.org/send" rel="nofollow">https://registry.npmjs.org/send</a> 100ms (from cache)<br> 137 silly pacote version manifest for [email protected] fetched in 118ms<br> 138 http fetch GET 304 <a href="https://registry.npmjs.org/serve-static" rel="nofollow">https://registry.npmjs.org/serve-static</a> 121ms (from cache)<br> 139 http fetch GET 200 <a href="https://registry.npmjs.org/querystring" rel="nofollow">https://registry.npmjs.org/querystring</a> 33ms (from cache)<br> 140 silly pacote version manifest for [email protected] fetched in 131ms<br> 141 http fetch GET 304 <a href="https://registry.npmjs.org/setprototypeof" rel="nofollow">https://registry.npmjs.org/setprototypeof</a> 118ms (from cache)<br> 142 silly pacote version manifest for [email protected] fetched in 39ms<br> 143 silly pacote version manifest for [email protected] fetched in 125ms<br> 144 http fetch GET 304 <a href="https://registry.npmjs.org/statuses" rel="nofollow">https://registry.npmjs.org/statuses</a> 122ms (from cache)<br> 145 silly pacote range manifest for statuses@~1.5.0 fetched in 127ms<br> 146 http fetch GET 304 <a href="https://registry.npmjs.org/utils-merge" rel="nofollow">https://registry.npmjs.org/utils-merge</a> 108ms (from cache)<br> 147 http fetch GET 304 <a href="https://registry.npmjs.org/blueimp-md5" rel="nofollow">https://registry.npmjs.org/blueimp-md5</a> 111ms (from cache)<br> 148 silly pacote version manifest for [email protected] fetched in 116ms<br> 149 http fetch GET 304 <a href="https://registry.npmjs.org/vary" rel="nofollow">https://registry.npmjs.org/vary</a> 121ms (from cache)<br> 150 http fetch GET 200 <a href="https://registry.npmjs.org/mongodb" rel="nofollow">https://registry.npmjs.org/mongodb</a> 26ms (from cache)<br> 151 http fetch GET 304 <a href="https://registry.npmjs.org/email-validator" rel="nofollow">https://registry.npmjs.org/email-validator</a> 130ms (from cache)<br> 152 silly pacote range manifest for blueimp-md5@^2.3.0 fetched in 134ms<br> 153 silly pacote range manifest for vary@~1.1.2 fetched in 139ms<br> 154 silly pacote version manifest for [email protected] fetched in 44ms<br> 155 silly pacote range manifest for email-validator@^2.0.3 fetched in 146ms<br> 156 silly pacote version manifest for [email protected] fetched in 11ms<br> 157 http fetch GET 304 <a href="https://registry.npmjs.org/yargs" rel="nofollow">https://registry.npmjs.org/yargs</a> 113ms (from cache)<br> 158 http fetch GET 304 <a href="https://registry.npmjs.org/bson" rel="nofollow">https://registry.npmjs.org/bson</a> 105ms (from cache)<br> 159 http fetch GET 304 <a href="https://registry.npmjs.org/kareem" rel="nofollow">https://registry.npmjs.org/kareem</a> 103ms (from cache)<br> 160 silly pacote range manifest for yargs@^11.0.0 fetched in 127ms<br> 161 http fetch GET 304 <a href="https://registry.npmjs.org/mongoose-legacy-pluralize" rel="nofollow">https://registry.npmjs.org/mongoose-legacy-pluralize</a> 97ms (from cache)<br> 162 silly pacote version manifest for [email protected] fetched in 125ms<br> 163 silly pacote range manifest for bson@~1.1.1 fetched in 133ms<br> 164 silly pacote version manifest for [email protected] fetched in 125ms<br> 165 http fetch GET 304 <a href="https://registry.npmjs.org/mpath" rel="nofollow">https://registry.npmjs.org/mpath</a> 120ms (from cache)<br> 166 silly pacote version manifest for [email protected] fetched in 132ms<br> 167 http fetch GET 304 <a href="https://registry.npmjs.org/regexp-clone" rel="nofollow">https://registry.npmjs.org/regexp-clone</a> 122ms (from cache)<br> 168 silly pacote version manifest for [email protected] fetched in 126ms<br> 169 http fetch GET 304 <a href="https://registry.npmjs.org/mquery" rel="nofollow">https://registry.npmjs.org/mquery</a> 131ms (from cache)<br> 170 http fetch GET 304 <a href="https://registry.npmjs.org/sliced" rel="nofollow">https://registry.npmjs.org/sliced</a> 122ms (from cache)<br> 171 http fetch GET 304 <a href="https://registry.npmjs.org/sift" rel="nofollow">https://registry.npmjs.org/sift</a> 115ms (from cache)<br> 172 silly pacote version manifest for [email protected] fetched in 151ms<br> 173 silly pacote version manifest for [email protected] fetched in 138ms<br> 174 silly pacote version manifest for [email protected] fetched in 145ms<br> 175 http fetch GET 304 <a href="https://registry.npmjs.org/braces" rel="nofollow">https://registry.npmjs.org/braces</a> 112ms (from cache)<br> 176 http fetch GET 304 <a href="https://registry.npmjs.org/async-each" rel="nofollow">https://registry.npmjs.org/async-each</a> 114ms (from cache)<br> 177 http fetch GET 304 <a href="https://registry.npmjs.org/anymatch" rel="nofollow">https://registry.npmjs.org/anymatch</a> 139ms (from cache)<br> 178 http fetch GET 304 <a href="https://registry.npmjs.org/inherits" rel="nofollow">https://registry.npmjs.org/inherits</a> 94ms (from cache)<br> 179 http fetch GET 304 <a href="https://registry.npmjs.org/glob-parent" rel="nofollow">https://registry.npmjs.org/glob-parent</a> 117ms (from cache)<br> 180 silly pacote range manifest for braces@^2.3.2 fetched in 128ms<br> 181 silly pacote range manifest for async-each@^1.0.1 fetched in 129ms<br> 182 silly pacote range manifest for anymatch@^2.0.0 fetched in 163ms<br> 183 silly pacote range manifest for inherits@^2.0.3 fetched in 113ms<br> 184 silly pacote range manifest for glob-parent@^3.1.0 fetched in 137ms<br> 185 silly pacote version manifest for [email protected] fetched in 15ms<br> 186 http fetch GET 304 <a href="https://registry.npmjs.org/is-binary-path" rel="nofollow">https://registry.npmjs.org/is-binary-path</a> 129ms (from cache)<br> 187 http fetch GET 200 <a href="https://registry.npmjs.org/fsevents" rel="nofollow">https://registry.npmjs.org/fsevents</a> 32ms (from cache)<br> 188 silly pacote range manifest for is-binary-path@^1.0.0 fetched in 136ms<br> 189 silly pacote range manifest for fsevents@^1.2.7 fetched in 39ms<br> 190 silly pacote range manifest for debug@^2.2.0 fetched in 8ms<br> 191 http fetch GET 304 <a href="https://registry.npmjs.org/normalize-path" rel="nofollow">https://registry.npmjs.org/normalize-path</a> 131ms (from cache)<br> 192 http fetch GET 304 <a href="https://registry.npmjs.org/path-is-absolute" rel="nofollow">https://registry.npmjs.org/path-is-absolute</a> 134ms (from cache)<br> 193 silly pacote range manifest for normalize-path@^3.0.0 fetched in 138ms<br> 194 silly pacote range manifest for path-is-absolute@^1.0.0 fetched in 139ms<br> 195 http fetch GET 304 <a href="https://registry.npmjs.org/is-glob" rel="nofollow">https://registry.npmjs.org/is-glob</a> 148ms (from cache)<br> 196 silly pacote range manifest for is-glob@^4.0.0 fetched in 158ms<br> 197 http fetch GET 304 <a href="https://registry.npmjs.org/readdirp" rel="nofollow">https://registry.npmjs.org/readdirp</a> 92ms (from cache)<br> 198 silly pacote range manifest for readdirp@^2.2.1 fetched in 103ms<br> 199 http fetch GET 304 <a href="https://registry.npmjs.org/upath" rel="nofollow">https://registry.npmjs.org/upath</a> 103ms (from cache)<br> 200 silly pacote range manifest for upath@^1.1.1 fetched in 107ms<br> 201 http fetch GET 304 <a href="https://registry.npmjs.org/brace-expansion" rel="nofollow">https://registry.npmjs.org/brace-expansion</a> 103ms (from cache)<br> 202 http fetch GET 200 <a href="https://registry.npmjs.org/is-ci" rel="nofollow">https://registry.npmjs.org/is-ci</a> 8ms (from cache)<br> 203 silly pacote range manifest for brace-expansion@^1.1.7 fetched in 108ms<br> 204 silly pacote range manifest for is-ci@^1.0.10 fetched in 19ms<br> 205 http fetch GET 304 <a href="https://registry.npmjs.org/has-flag" rel="nofollow">https://registry.npmjs.org/has-flag</a> 100ms (from cache)<br> 206 http fetch GET 304 <a href="https://registry.npmjs.org/nopt" rel="nofollow">https://registry.npmjs.org/nopt</a> 94ms (from cache)<br> 207 silly pacote range manifest for has-flag@^3.0.0 fetched in 114ms<br> 208 silly pacote range manifest for nopt@~1.0.10 fetched in 105ms<br> 209 http fetch GET 304 <a href="https://registry.npmjs.org/boxen" rel="nofollow">https://registry.npmjs.org/boxen</a> 101ms (from cache)<br> 210 http fetch GET 200 <a href="https://registry.npmjs.org/semver-diff" rel="nofollow">https://registry.npmjs.org/semver-diff</a> 14ms (from cache)<br> 211 silly pacote range manifest for boxen@^1.2.1 fetched in 108ms<br> 212 silly pacote range manifest for semver-diff@^2.0.0 fetched in 23ms<br> 213 silly pacote version manifest for [email protected] fetched in 9ms<br> 214 http fetch GET 304 <a href="https://registry.npmjs.org/chalk" rel="nofollow">https://registry.npmjs.org/chalk</a> 102ms (from cache)<br> 215 silly pacote range manifest for statuses@&gt;= 1.5.0 &lt; 2 fetched in 9ms<br> 216 http fetch GET 304 <a href="https://registry.npmjs.org/configstore" rel="nofollow">https://registry.npmjs.org/configstore</a> 107ms (from cache)<br> 217 silly pacote range manifest for chalk@^2.0.1 fetched in 112ms<br> 218 http fetch GET 304 <a href="https://registry.npmjs.org/import-lazy" rel="nofollow">https://registry.npmjs.org/import-lazy</a> 105ms (from cache)<br> 219 silly pacote range manifest for configstore@^3.0.0 fetched in 119ms<br> 220 silly pacote range manifest for import-lazy@^2.1.0 fetched in 118ms<br> 221 http fetch GET 304 <a href="https://registry.npmjs.org/is-installed-globally" rel="nofollow">https://registry.npmjs.org/is-installed-globally</a> 114ms (from cache)<br> 222 http fetch GET 304 <a href="https://registry.npmjs.org/is-npm" rel="nofollow">https://registry.npmjs.org/is-npm</a> 152ms (from cache)<br> 223 silly pacote range manifest for is-installed-globally@^0.1.0 fetched in 171ms<br> 224 silly pacote range manifest for is-npm@^1.0.0 fetched in 165ms<br> 225 http fetch GET 304 <a href="https://registry.npmjs.org/latest-version" rel="nofollow">https://registry.npmjs.org/latest-version</a> 171ms (from cache)<br> 226 silly pacote range manifest for latest-version@^3.0.0 fetched in 185ms<br> 227 silly pacote range manifest for safe-buffer@^5.0.1 fetched in 4ms<br> 228 http fetch GET 304 <a href="https://registry.npmjs.org/xdg-basedir" rel="nofollow">https://registry.npmjs.org/xdg-basedir</a> 164ms (from cache)<br> 229 silly pacote range manifest for xdg-basedir@^3.0.0 fetched in 183ms<br> 230 http fetch GET 304 <a href="https://registry.npmjs.org/toidentifier" rel="nofollow">https://registry.npmjs.org/toidentifier</a> 163ms (from cache)<br> 231 http fetch GET 304 <a href="https://registry.npmjs.org/safer-buffer" rel="nofollow">https://registry.npmjs.org/safer-buffer</a> 157ms (from cache)<br> 232 silly pacote version manifest for [email protected] fetched in 172ms<br> 233 http fetch GET 304 <a href="https://registry.npmjs.org/unpipe" rel="nofollow">https://registry.npmjs.org/unpipe</a> 151ms (from cache)<br> 234 http fetch GET 304 <a href="https://registry.npmjs.org/ee-first" rel="nofollow">https://registry.npmjs.org/ee-first</a> 159ms (from cache)<br> 235 http fetch GET 304 <a href="https://registry.npmjs.org/media-typer" rel="nofollow">https://registry.npmjs.org/media-typer</a> 142ms (from cache)<br> 236 silly pacote range manifest for safer-buffer@&gt;= 2.1.2 &lt; 3 fetched in 167ms<br> 237 silly pacote version manifest for [email protected] fetched in 160ms<br> 238 silly pacote version manifest for [email protected] fetched in 169ms<br> 239 silly pacote version manifest for [email protected] fetched in 152ms<br> 240 silly pacote range manifest for http-errors@~1.7.2 fetched in 5ms<br> 241 silly pacote version manifest for [email protected] fetched in 8ms<br> 242 http fetch GET 200 <a href="https://registry.npmjs.org/mime" rel="nofollow">https://registry.npmjs.org/mime</a> 12ms (from cache)<br> 243 silly pacote version manifest for [email protected] fetched in 18ms<br> 244 silly pacote range manifest for bson@^1.1.1 fetched in 6ms<br> 245 http fetch GET 304 <a href="https://registry.npmjs.org/mime-types" rel="nofollow">https://registry.npmjs.org/mime-types</a> 103ms (from cache)<br> 246 http fetch GET 304 <a href="https://registry.npmjs.org/jwa" rel="nofollow">https://registry.npmjs.org/jwa</a> 101ms (from cache)<br> 247 silly pacote range manifest for mime-types@~2.1.24 fetched in 112ms<br> 248 silly pacote range manifest for jwa@^1.4.1 fetched in 109ms<br> 249 http fetch GET 200 <a href="https://registry.npmjs.org/denque" rel="nofollow">https://registry.npmjs.org/denque</a> 25ms (from cache)<br> 250 silly pacote range manifest for safe-buffer@^5.1.2 fetched in 13ms<br> 251 http fetch GET 304 <a href="https://registry.npmjs.org/negotiator" rel="nofollow">https://registry.npmjs.org/negotiator</a> 103ms (from cache)<br> 252 silly pacote range manifest for denque@^1.4.1 fetched in 35ms<br> 253 silly pacote version manifest for [email protected] fetched in 112ms<br> 254 http fetch GET 304 <a href="https://registry.npmjs.org/unpipe" rel="nofollow">https://registry.npmjs.org/unpipe</a> 91ms (from cache)<br> 255 http fetch GET 200 <a href="https://registry.npmjs.org/saslprep" rel="nofollow">https://registry.npmjs.org/saslprep</a> 19ms (from cache)<br> 256 silly pacote range manifest for unpipe@~1.0.0 fetched in 101ms<br> 257 silly pacote range manifest for saslprep@^1.0.0 fetched in 27ms<br> 258 http fetch GET 304 <a href="https://registry.npmjs.org/forwarded" rel="nofollow">https://registry.npmjs.org/forwarded</a> 98ms (from cache)<br> 259 silly pacote range manifest for forwarded@~0.1.2 fetched in 106ms<br> 260 http fetch GET 304 <a href="https://registry.npmjs.org/destroy" rel="nofollow">https://registry.npmjs.org/destroy</a> 94ms (from cache)<br> 261 http fetch GET 200 <a href="https://registry.npmjs.org/find-up" rel="nofollow">https://registry.npmjs.org/find-up</a> 13ms (from cache)<br> 262 http fetch GET 304 <a href="https://registry.npmjs.org/ipaddr.js" rel="nofollow">https://registry.npmjs.org/ipaddr.js</a> 103ms (from cache)<br> 263 http fetch GET 304 <a href="https://registry.npmjs.org/bl" rel="nofollow">https://registry.npmjs.org/bl</a> 85ms (from cache)<br> 264 silly pacote range manifest for destroy@~1.0.4 fetched in 100ms<br> 265 silly pacote range manifest for find-up@^2.1.0 fetched in 20ms<br> 266 silly pacote version manifest for [email protected] fetched in 111ms<br> 267 silly pacote range manifest for bl@^2.2.0 fetched in 95ms<br> 268 http fetch GET 200 <a href="https://registry.npmjs.org/require-directory" rel="nofollow">https://registry.npmjs.org/require-directory</a> 24ms (from cache)<br> 269 http fetch GET 304 <a href="https://registry.npmjs.org/require_optional" rel="nofollow">https://registry.npmjs.org/require_optional</a> 92ms (from cache)<br> 270 silly pacote range manifest for require-directory@^2.1.1 fetched in 31ms<br> 271 silly pacote range manifest for require_optional@^1.0.1 fetched in 97ms<br> 272 http fetch GET 304 <a href="https://registry.npmjs.org/decamelize" rel="nofollow">https://registry.npmjs.org/decamelize</a> 93ms (from cache)<br> 273 http fetch GET 304 <a href="https://registry.npmjs.org/cliui" rel="nofollow">https://registry.npmjs.org/cliui</a> 100ms (from cache)<br> 274 silly pacote range manifest for decamelize@^1.1.1 fetched in 104ms<br> 275 http fetch GET 304 <a href="https://registry.npmjs.org/get-caller-file" rel="nofollow">https://registry.npmjs.org/get-caller-file</a> 91ms (from cache)<br> 276 silly pacote range manifest for cliui@^4.0.0 fetched in 113ms<br> 277 http fetch GET 304 <a href="https://registry.npmjs.org/os-locale" rel="nofollow">https://registry.npmjs.org/os-locale</a> 91ms (from cache)<br> 278 silly pacote range manifest for get-caller-file@^1.0.1 fetched in 103ms<br> 279 silly pacote range manifest for os-locale@^3.1.0 fetched in 102ms<br> 280 http fetch GET 304 <a href="https://registry.npmjs.org/require-main-filename" rel="nofollow">https://registry.npmjs.org/require-main-filename</a> 92ms (from cache)<br> 281 silly pacote version manifest for [email protected] fetched in 7ms<br> 282 http fetch GET 304 <a href="https://registry.npmjs.org/set-blocking" rel="nofollow">https://registry.npmjs.org/set-blocking</a> 95ms (from cache)<br> 283 http fetch GET 304 <a href="https://registry.npmjs.org/string-width" rel="nofollow">https://registry.npmjs.org/string-width</a> 87ms (from cache)<br> 284 silly pacote range manifest for require-main-filename@^1.0.1 fetched in 100ms<br> 285 silly pacote range manifest for regexp-clone@^1.0.0 fetched in 6ms<br> 286 silly pacote range manifest for set-blocking@^2.0.0 fetched in 103ms<br> 287 silly pacote range manifest for string-width@^2.0.0 fetched in 95ms<br> 288 http fetch GET 304 <a href="https://registry.npmjs.org/which-module" rel="nofollow">https://registry.npmjs.org/which-module</a> 91ms (from cache)<br> 289 http fetch GET 304 <a href="https://registry.npmjs.org/y18n" rel="nofollow">https://registry.npmjs.org/y18n</a> 91ms (from cache)<br> 290 silly pacote range manifest for which-module@^2.0.0 fetched in 99ms<br> 291 silly pacote range manifest for y18n@^3.2.1 fetched in 98ms<br> 292 http fetch GET 304 <a href="https://registry.npmjs.org/yargs-parser" rel="nofollow">https://registry.npmjs.org/yargs-parser</a> 101ms (from cache)<br> 293 silly pacote range manifest for yargs-parser@^9.0.2 fetched in 110ms<br> 294 http fetch GET 304 <a href="https://registry.npmjs.org/bluebird" rel="nofollow">https://registry.npmjs.org/bluebird</a> 106ms (from cache)<br> 295 silly pacote version manifest for [email protected] fetched in 119ms<br> 296 http fetch GET 304 <a href="https://registry.npmjs.org/fill-range" rel="nofollow">https://registry.npmjs.org/fill-range</a> 102ms (from cache)<br> 297 http fetch GET 304 <a href="https://registry.npmjs.org/array-unique" rel="nofollow">https://registry.npmjs.org/array-unique</a> 109ms (from cache)<br> 298 http fetch GET 304 <a href="https://registry.npmjs.org/arr-flatten" rel="nofollow">https://registry.npmjs.org/arr-flatten</a> 114ms (from cache)<br> 299 silly pacote range manifest for fill-range@^4.0.0 fetched in 107ms<br> 300 http fetch GET 304 <a href="https://registry.npmjs.org/extend-shallow" rel="nofollow">https://registry.npmjs.org/extend-shallow</a> 113ms (from cache)<br> 301 silly pacote range manifest for array-unique@^0.3.2 fetched in 115ms<br> 302 silly pacote range manifest for arr-flatten@^1.1.0 fetched in 120ms<br> 303 http fetch GET 304 <a href="https://registry.npmjs.org/isobject" rel="nofollow">https://registry.npmjs.org/isobject</a> 109ms (from cache)<br> 304 silly pacote range manifest for extend-shallow@^2.0.1 fetched in 120ms<br> 305 silly pacote range manifest for normalize-path@^2.1.1 fetched in 10ms<br> 306 silly pacote range manifest for isobject@^3.0.1 fetched in 122ms<br> 307 silly pacote range manifest for is-glob@^3.1.0 fetched in 9ms<br> 308 http fetch GET 304 <a href="https://registry.npmjs.org/snapdragon" rel="nofollow">https://registry.npmjs.org/snapdragon</a> 102ms (from cache)<br> 309 http fetch GET 304 <a href="https://registry.npmjs.org/repeat-element" rel="nofollow">https://registry.npmjs.org/repeat-element</a> 107ms (from cache)<br> 310 silly pacote range manifest for snapdragon@^0.8.1 fetched in 115ms<br> 311 silly pacote range manifest for repeat-element@^1.1.2 fetched in 119ms<br> 312 http fetch GET 304 <a href="https://registry.npmjs.org/snapdragon-node" rel="nofollow">https://registry.npmjs.org/snapdragon-node</a> 80ms (from cache)<br> 313 silly pacote range manifest for snapdragon-node@^2.0.1 fetched in 82ms<br> 314 http fetch GET 304 <a href="https://registry.npmjs.org/micromatch" rel="nofollow">https://registry.npmjs.org/micromatch</a> 61ms (from cache)<br> 315 silly fetchPackageMetaData error for micromatch@^3.1.4 Unexpected end of JSON input while parsing near '..."dependencies":{"arr-'<br> 316 http fetch GET 304 <a href="https://registry.npmjs.org/path-dirname" rel="nofollow">https://registry.npmjs.org/path-dirname</a> 73ms (from cache)<br> 317 silly pacote range manifest for path-dirname@^1.0.0 fetched in 82ms<br> 318 http fetch GET 304 <a href="https://registry.npmjs.org/binary-extensions" rel="nofollow">https://registry.npmjs.org/binary-extensions</a> 85ms (from cache)<br> 319 http fetch GET 304 <a href="https://registry.npmjs.org/split-string" rel="nofollow">https://registry.npmjs.org/split-string</a> 119ms (from cache)<br> 320 silly pacote range manifest for binary-extensions@^1.0.0 fetched in 93ms<br> 321 http fetch GET 304 <a href="https://registry.npmjs.org/nan" rel="nofollow">https://registry.npmjs.org/nan</a> 82ms (from cache)<br> 322 silly pacote range manifest for split-string@^3.0.2 fetched in 135ms<br> 323 silly pacote range manifest for nan@^2.12.1 fetched in 95ms<br> 324 http fetch GET 304 <a href="https://registry.npmjs.org/to-regex" rel="nofollow">https://registry.npmjs.org/to-regex</a> 144ms (from cache)<br> 325 http fetch GET 304 <a href="https://registry.npmjs.org/bindings" rel="nofollow">https://registry.npmjs.org/bindings</a> 128ms (from cache)<br> 326 http fetch GET 304 <a href="https://registry.npmjs.org/node-pre-gyp" rel="nofollow">https://registry.npmjs.org/node-pre-gyp</a> 115ms (from cache)<br> 327 silly pacote range manifest for to-regex@^3.0.1 fetched in 157ms<br> 328 silly pacote range manifest for bindings@^1.5.0 fetched in 143ms<br> 329 silly pacote range manifest for node-pre-gyp@* fetched in 129ms<br> 330 http fetch GET 304 <a href="https://registry.npmjs.org/is-extglob" rel="nofollow">https://registry.npmjs.org/is-extglob</a> 124ms (from cache)<br> 331 silly pacote range manifest for is-extglob@^2.1.1 fetched in 147ms<br> 332 http fetch GET 304 <a href="https://registry.npmjs.org/graceful-fs" rel="nofollow">https://registry.npmjs.org/graceful-fs</a> 143ms (from cache)<br> 333 http fetch GET 304 <a href="https://registry.npmjs.org/micromatch" rel="nofollow">https://registry.npmjs.org/micromatch</a> 120ms (from cache)<br> 334 silly fetchPackageMetaData error for micromatch@^3.1.10 Unexpected end of JSON input while parsing near '..."dependencies":{"arr-'<br> 335 silly pacote range manifest for graceful-fs@^4.1.11 fetched in 157ms<br> 336 http fetch GET 304 <a href="https://registry.npmjs.org/readable-stream" rel="nofollow">https://registry.npmjs.org/readable-stream</a> 125ms (from cache)<br> 337 http fetch GET 304 <a href="https://registry.npmjs.org/balanced-match" rel="nofollow">https://registry.npmjs.org/balanced-match</a> 119ms (from cache)<br> 338 silly pacote range manifest for readable-stream@^2.0.2 fetched in 134ms<br> 339 silly pacote range manifest for balanced-match@^1.0.0 fetched in 131ms<br> 340 silly pacote range manifest for semver@^5.0.3 fetched in 11ms<br> 341 http fetch GET 304 <a href="https://registry.npmjs.org/concat-map" rel="nofollow">https://registry.npmjs.org/concat-map</a> 134ms (from cache)<br> 342 http fetch GET 304 <a href="https://registry.npmjs.org/ci-info" rel="nofollow">https://registry.npmjs.org/ci-info</a> 117ms (from cache)<br> 343 http fetch GET 304 <a href="https://registry.npmjs.org/abbrev" rel="nofollow">https://registry.npmjs.org/abbrev</a> 118ms (from cache)<br> 344 silly pacote version manifest for [email protected] fetched in 145ms<br> 345 silly pacote range manifest for ci-info@^1.5.0 fetched in 128ms<br> 346 silly pacote range manifest for abbrev@1 fetched in 128ms<br> 347 silly pacote range manifest for supports-color@^5.3.0 fetched in 6ms<br> 348 http fetch GET 304 <a href="https://registry.npmjs.org/ansi-align" rel="nofollow">https://registry.npmjs.org/ansi-align</a> 122ms (from cache)<br> 349 silly pacote range manifest for graceful-fs@^4.1.2 fetched in 6ms<br> 350 silly pacote range manifest for ansi-align@^2.0.0 fetched in 129ms<br> 351 http fetch GET 304 <a href="https://registry.npmjs.org/camelcase" rel="nofollow">https://registry.npmjs.org/camelcase</a> 108ms (from cache)<br> 352 silly pacote range manifest for camelcase@^4.0.0 fetched in 119ms<br> 353 http fetch GET 200 <a href="https://registry.npmjs.org/make-dir" rel="nofollow">https://registry.npmjs.org/make-dir</a> 19ms (from cache)<br> 354 http fetch GET 304 <a href="https://registry.npmjs.org/term-size" rel="nofollow">https://registry.npmjs.org/term-size</a> 102ms (from cache)<br> 355 silly pacote range manifest for make-dir@^1.0.0 fetched in 36ms<br> 356 http fetch GET 304 <a href="https://registry.npmjs.org/cli-boxes" rel="nofollow">https://registry.npmjs.org/cli-boxes</a> 118ms (from cache)<br> 357 silly pacote range manifest for term-size@^1.2.0 fetched in 117ms<br> 358 silly pacote range manifest for cli-boxes@^1.0.0 fetched in 129ms<br> 359 http fetch GET 304 <a href="https://registry.npmjs.org/widest-line" rel="nofollow">https://registry.npmjs.org/widest-line</a> 116ms (from cache)<br> 360 silly pacote range manifest for widest-line@^2.0.0 fetched in 120ms<br> 361 silly pacote version manifest for [email protected] fetched in 2ms<br> 362 http fetch GET 304 <a href="https://registry.npmjs.org/ansi-styles" rel="nofollow">https://registry.npmjs.org/ansi-styles</a> 103ms (from cache)<br> 363 silly pacote range manifest for ansi-styles@^3.2.1 fetched in 112ms<br> 364 http fetch GET 304 <a href="https://registry.npmjs.org/unique-string" rel="nofollow">https://registry.npmjs.org/unique-string</a> 80ms (from cache)<br> 365 http fetch GET 304 <a href="https://registry.npmjs.org/dot-prop" rel="nofollow">https://registry.npmjs.org/dot-prop</a> 94ms (from cache)<br> 366 http fetch GET 304 <a href="https://registry.npmjs.org/escape-string-regexp" rel="nofollow">https://registry.npmjs.org/escape-string-regexp</a> 101ms (from cache)<br> 367 silly pacote range manifest for unique-string@^1.0.0 fetched in 87ms<br> 368 silly pacote range manifest for dot-prop@^4.1.0 fetched in 102ms<br> 369 silly pacote range manifest for escape-string-regexp@^1.0.5 fetched in 110ms<br> 370 http fetch GET 304 <a href="https://registry.npmjs.org/is-path-inside" rel="nofollow">https://registry.npmjs.org/is-path-inside</a> 84ms (from cache)<br> 371 http fetch GET 304 <a href="https://registry.npmjs.org/package-json" rel="nofollow">https://registry.npmjs.org/package-json</a> 76ms (from cache)<br> 372 silly pacote range manifest for is-path-inside@^1.0.0 fetched in 89ms<br> 373 silly pacote range manifest for package-json@^4.0.0 fetched in 82ms<br> 374 http fetch GET 304 <a href="https://registry.npmjs.org/global-dirs" rel="nofollow">https://registry.npmjs.org/global-dirs</a> 99ms (from cache)<br> 375 http fetch GET 304 <a href="https://registry.npmjs.org/write-file-atomic" rel="nofollow">https://registry.npmjs.org/write-file-atomic</a> 119ms (from cache)<br> 376 silly pacote range manifest for readable-stream@^2.3.5 fetched in 9ms<br> 377 silly pacote range manifest for safe-buffer@^5.1.1 fetched in 9ms<br> 378 silly pacote range manifest for global-dirs@^0.1.0 fetched in 108ms<br> 379 silly pacote range manifest for write-file-atomic@^2.0.0 fetched in 129ms<br> 380 silly pacote range manifest for semver@^5.1.0 fetched in 10ms<br> 381 silly pacote range manifest for string-width@^2.1.1 fetched in 8ms<br> 382 http fetch GET 304 <a href="https://registry.npmjs.org/buffer-equal-constant-time" rel="nofollow">https://registry.npmjs.org/buffer-equal-constant-time</a> 75ms (from cache)<br> 383 http fetch GET 200 <a href="https://registry.npmjs.org/resolve-from" rel="nofollow">https://registry.npmjs.org/resolve-from</a> 21ms (from cache)<br> 384 http fetch GET 304 <a href="https://registry.npmjs.org/mime-db" rel="nofollow">https://registry.npmjs.org/mime-db</a> 98ms (from cache)<br> 385 silly pacote version manifest for [email protected] fetched in 91ms<br> 386 silly pacote range manifest for resolve-from@^2.0.0 fetched in 36ms<br> 387 silly pacote version manifest for [email protected] fetched in 114ms<br> 388 http fetch GET 304 <a href="https://registry.npmjs.org/locate-path" rel="nofollow">https://registry.npmjs.org/locate-path</a> 108ms (from cache)<br> 389 http fetch GET 304 <a href="https://registry.npmjs.org/sparse-bitfield" rel="nofollow">https://registry.npmjs.org/sparse-bitfield</a> 115ms (from cache)<br> 390 http fetch GET 304 <a href="https://registry.npmjs.org/ecdsa-sig-formatter" rel="nofollow">https://registry.npmjs.org/ecdsa-sig-formatter</a> 118ms (from cache)<br> 391 silly pacote range manifest for locate-path@^2.0.0 fetched in 120ms<br> 392 silly pacote range manifest for sparse-bitfield@^3.0.3 fetched in 129ms<br> 393 silly pacote version manifest for [email protected] fetched in 131ms<br> 394 silly pacote range manifest for camelcase@^4.1.0 fetched in 6ms<br> 395 http fetch GET 304 <a href="https://registry.npmjs.org/wrap-ansi" rel="nofollow">https://registry.npmjs.org/wrap-ansi</a> 97ms (from cache)<br> 396 http fetch GET 304 <a href="https://registry.npmjs.org/strip-ansi" rel="nofollow">https://registry.npmjs.org/strip-ansi</a> 101ms (from cache)<br> 397 silly pacote range manifest for wrap-ansi@^2.0.0 fetched in 100ms<br> 398 silly pacote range manifest for strip-ansi@^4.0.0 fetched in 105ms<br> 399 http fetch GET 304 <a href="https://registry.npmjs.org/execa" rel="nofollow">https://registry.npmjs.org/execa</a> 97ms (from cache)<br> 400 http fetch GET 304 <a href="https://registry.npmjs.org/lcid" rel="nofollow">https://registry.npmjs.org/lcid</a> 85ms (from cache)<br> 401 silly pacote range manifest for execa@^1.0.0 fetched in 103ms<br> 402 silly pacote range manifest for lcid@^2.0.0 fetched in 95ms<br> 403 silly pacote range manifest for is-extglob@^2.1.0 fetched in 7ms<br> 404 http fetch GET 304 <a href="https://registry.npmjs.org/mem" rel="nofollow">https://registry.npmjs.org/mem</a> 92ms (from cache)<br> 405 http fetch GET 304 <a href="https://registry.npmjs.org/is-fullwidth-code-point" rel="nofollow">https://registry.npmjs.org/is-fullwidth-code-point</a> 97ms (from cache)<br> 406 silly pacote range manifest for mem@^4.0.0 fetched in 106ms<br> 407 http fetch GET 200 <a href="https://registry.npmjs.org/define-property" rel="nofollow">https://registry.npmjs.org/define-property</a> 24ms (from cache)<br> 408 silly pacote range manifest for is-fullwidth-code-point@^2.0.0 fetched in 107ms<br> 409 silly pacote range manifest for define-property@^0.2.5 fetched in 33ms<br> 410 http fetch GET 304 <a href="https://registry.npmjs.org/is-number" rel="nofollow">https://registry.npmjs.org/is-number</a> 99ms (from cache)<br> 411 silly pacote range manifest for is-number@^3.0.0 fetched in 104ms<br> 412 http fetch GET 304 <a href="https://registry.npmjs.org/repeat-string" rel="nofollow">https://registry.npmjs.org/repeat-string</a> 106ms (from cache)<br> 413 http fetch GET 304 <a href="https://registry.npmjs.org/to-regex-range" rel="nofollow">https://registry.npmjs.org/to-regex-range</a> 107ms (from cache)<br> 414 http fetch GET 304 <a href="https://registry.npmjs.org/is-extendable" rel="nofollow">https://registry.npmjs.org/is-extendable</a> 82ms (from cache)<br> 415 silly pacote range manifest for repeat-string@^1.6.1 fetched in 112ms<br> 416 silly pacote range manifest for to-regex-range@^2.1.0 fetched in 112ms<br> 417 silly pacote range manifest for is-extendable@^0.1.0 fetched in 87ms<br> 418 silly pacote range manifest for isobject@^3.0.0 fetched in 6ms<br> 419 silly pacote range manifest for define-property@^1.0.0 fetched in 9ms<br> 420 http fetch GET 304 <a href="https://registry.npmjs.org/remove-trailing-separator" rel="nofollow">https://registry.npmjs.org/remove-trailing-separator</a> 98ms (from cache)<br> 421 http fetch GET 304 <a href="https://registry.npmjs.org/base" rel="nofollow">https://registry.npmjs.org/base</a> 87ms (from cache)<br> 422 silly pacote range manifest for extend-shallow@^3.0.0 fetched in 18ms<br> 423 silly pacote range manifest for define-property@^2.0.2 fetched in 18ms<br> 424 silly pacote range manifest for remove-trailing-separator@^1.0.1 fetched in 116ms<br> 425 silly pacote range manifest for base@^0.11.1 fetched in 104ms<br> 426 silly pacote range manifest for extend-shallow@^3.0.2 fetched in 14ms<br> 427 http fetch GET 304 <a href="https://registry.npmjs.org/map-cache" rel="nofollow">https://registry.npmjs.org/map-cache</a> 115ms (from cache)<br> 428 http fetch GET 304 <a href="https://registry.npmjs.org/source-map" rel="nofollow">https://registry.npmjs.org/source-map</a> 108ms (from cache)<br> 429 silly pacote range manifest for map-cache@^0.2.2 fetched in 118ms<br> 430 silly pacote range manifest for source-map@^0.5.6 fetched in 113ms<br> 431 http fetch GET 304 <a href="https://registry.npmjs.org/source-map-resolve" rel="nofollow">https://registry.npmjs.org/source-map-resolve</a> 112ms (from cache)<br> 432 silly pacote range manifest for source-map-resolve@^0.5.0 fetched in 118ms<br> 433 http fetch GET 304 <a href="https://registry.npmjs.org/use" rel="nofollow">https://registry.npmjs.org/use</a> 99ms (from cache)<br> 434 silly pacote range manifest for nopt@^4.0.1 fetched in 6ms<br> 435 silly pacote range manifest for use@^3.1.0 fetched in 104ms<br> 436 http fetch GET 304 <a href="https://registry.npmjs.org/snapdragon-util" rel="nofollow">https://registry.npmjs.org/snapdragon-util</a> 96ms (from cache)<br> 437 silly pacote range manifest for snapdragon-util@^3.0.1 fetched in 108ms<br> 438 http fetch GET 304 <a href="https://registry.npmjs.org/regex-not" rel="nofollow">https://registry.npmjs.org/regex-not</a> 98ms (from cache)<br> 439 silly pacote range manifest for regex-not@^1.0.2 fetched in 102ms<br> 440 http fetch GET 304 <a href="https://registry.npmjs.org/file-uri-to-path" rel="nofollow">https://registry.npmjs.org/file-uri-to-path</a> 103ms (from cache)<br> 441 http fetch GET 200 <a href="https://registry.npmjs.org/rimraf" rel="nofollow">https://registry.npmjs.org/rimraf</a> 13ms (from cache)<br> 442 http fetch GET 304 <a href="https://registry.npmjs.org/detect-libc" rel="nofollow">https://registry.npmjs.org/detect-libc</a> 103ms (from cache)<br> 443 silly pacote version manifest for [email protected] fetched in 109ms<br> 444 silly pacote range manifest for detect-libc@^1.0.2 fetched in 108ms<br> 445 http fetch GET 304 <a href="https://registry.npmjs.org/safe-regex" rel="nofollow">https://registry.npmjs.org/safe-regex</a> 114ms (from cache)<br> 446 silly pacote range manifest for rimraf@^2.6.1 fetched in 20ms<br> 447 silly pacote range manifest for semver@^5.3.0 fetched in 4ms<br> 448 http fetch GET 304 <a href="https://registry.npmjs.org/mkdirp" rel="nofollow">https://registry.npmjs.org/mkdirp</a> 82ms (from cache)<br> 449 http fetch GET 304 <a href="https://registry.npmjs.org/needle" rel="nofollow">https://registry.npmjs.org/needle</a> 85ms (from cache)<br> 450 silly pacote range manifest for safe-regex@^1.1.0 fetched in 123ms<br> 451 silly pacote range manifest for mkdirp@^0.5.1 fetched in 93ms<br> 452 silly pacote range manifest for inherits@~2.0.3 fetched in 11ms<br> 453 silly pacote range manifest for needle@^2.2.1 fetched in 97ms<br> 454 silly pacote range manifest for safe-buffer@~5.1.1 fetched in 7ms<br> 455 http fetch GET 304 <a href="https://registry.npmjs.org/npm-packlist" rel="nofollow">https://registry.npmjs.org/npm-packlist</a> 83ms (from cache)<br> 456 silly pacote range manifest for npm-packlist@^1.1.6 fetched in 92ms<br> 457 http fetch GET 304 <a href="https://registry.npmjs.org/rc" rel="nofollow">https://registry.npmjs.org/rc</a> 81ms (from cache)<br> 458 silly pacote range manifest for rc@^1.2.7 fetched in 86ms<br> 459 http fetch GET 304 <a href="https://registry.npmjs.org/npmlog" rel="nofollow">https://registry.npmjs.org/npmlog</a> 109ms (from cache)<br> 460 silly pacote range manifest for execa@^0.7.0 fetched in 9ms<br> 461 silly pacote range manifest for npmlog@^4.0.2 fetched in 120ms<br> 462 http fetch GET 304 <a href="https://registry.npmjs.org/tar" rel="nofollow">https://registry.npmjs.org/tar</a> 84ms (from cache)<br> 463 http fetch GET 304 <a href="https://registry.npmjs.org/core-util-is" rel="nofollow">https://registry.npmjs.org/core-util-is</a> 87ms (from cache)<br> 464 silly pacote range manifest for tar@^4.4.2 fetched in 89ms<br> 465 http fetch GET 304 <a href="https://registry.npmjs.org/process-nextick-args" rel="nofollow">https://registry.npmjs.org/process-nextick-args</a> 84ms (from cache)<br> 466 silly pacote range manifest for core-util-is@~1.0.0 fetched in 100ms<br> 467 silly pacote range manifest for process-nextick-args@~2.0.0 fetched in 96ms<br> 468 http fetch GET 304 <a href="https://registry.npmjs.org/isarray" rel="nofollow">https://registry.npmjs.org/isarray</a> 101ms (from cache)<br> 469 silly pacote range manifest for isarray@~1.0.0 fetched in 106ms<br> 470 http fetch GET 304 <a href="https://registry.npmjs.org/string_decoder" rel="nofollow">https://registry.npmjs.org/string_decoder</a> 96ms (from cache)<br> 471 http fetch GET 304 <a href="https://registry.npmjs.org/util-deprecate" rel="nofollow">https://registry.npmjs.org/util-deprecate</a> 95ms (from cache)<br> 472 silly pacote range manifest for string_decoder@~1.1.1 fetched in 103ms<br> 473 silly pacote range manifest for util-deprecate@~1.0.1 fetched in 109ms<br> 474 http fetch GET 200 <a href="https://registry.npmjs.org/registry-url" rel="nofollow">https://registry.npmjs.org/registry-url</a> 20ms (from cache)<br> 475 silly pacote range manifest for registry-url@^3.0.3 fetched in 24ms<br> 476 http fetch GET 304 <a href="https://registry.npmjs.org/pify" rel="nofollow">https://registry.npmjs.org/pify</a> 115ms (from cache)<br> 477 silly pacote range manifest for pify@^3.0.0 fetched in 117ms<br> 478 http fetch GET 304 <a href="https://registry.npmjs.org/crypto-random-string" rel="nofollow">https://registry.npmjs.org/crypto-random-string</a> 85ms (from cache)<br> 479 silly pacote range manifest for crypto-random-string@^1.0.0 fetched in 94ms<br> 480 http fetch GET 304 <a href="https://registry.npmjs.org/color-convert" rel="nofollow">https://registry.npmjs.org/color-convert</a> 109ms (from cache)<br> 481 silly pacote range manifest for color-convert@^1.9.0 fetched in 116ms<br> 482 http fetch GET 304 <a href="https://registry.npmjs.org/path-is-inside" rel="nofollow">https://registry.npmjs.org/path-is-inside</a> 82ms (from cache)<br> 483 silly pacote range manifest for path-is-inside@^1.0.1 fetched in 86ms<br> 484 http fetch GET 304 <a href="https://registry.npmjs.org/is-obj" rel="nofollow">https://registry.npmjs.org/is-obj</a> 112ms (from cache)<br> 485 http fetch GET 304 <a href="https://registry.npmjs.org/registry-auth-token" rel="nofollow">https://registry.npmjs.org/registry-auth-token</a> 88ms (from cache)<br> 486 http fetch GET 304 <a href="https://registry.npmjs.org/got" rel="nofollow">https://registry.npmjs.org/got</a> 95ms (from cache)<br> 487 silly pacote range manifest for is-obj@^1.0.0 fetched in 123ms<br> 488 silly pacote range manifest for registry-auth-token@^3.0.1 fetched in 98ms<br> 489 silly pacote range manifest for got@^6.7.1 fetched in 107ms<br> 490 silly pacote range manifest for string-width@^1.0.1 fetched in 12ms<br> 491 silly pacote range manifest for strip-ansi@^3.0.1 fetched in 12ms<br> 492 http fetch GET 304 <a href="https://registry.npmjs.org/ini" rel="nofollow">https://registry.npmjs.org/ini</a> 107ms (from cache)<br> 493 silly pacote range manifest for ini@^1.3.4 fetched in 118ms<br> 494 http fetch GET 304 <a href="https://registry.npmjs.org/signal-exit" rel="nofollow">https://registry.npmjs.org/signal-exit</a> 108ms (from cache)<br> 495 silly pacote range manifest for signal-exit@^3.0.2 fetched in 116ms<br> 496 http fetch GET 304 <a href="https://registry.npmjs.org/imurmurhash" rel="nofollow">https://registry.npmjs.org/imurmurhash</a> 126ms (from cache)<br> 497 silly pacote range manifest for imurmurhash@^0.1.4 fetched in 133ms<br> 498 http fetch GET 304 <a href="https://registry.npmjs.org/path-exists" rel="nofollow">https://registry.npmjs.org/path-exists</a> 110ms (from cache)<br> 499 http fetch GET 304 <a href="https://registry.npmjs.org/p-locate" rel="nofollow">https://registry.npmjs.org/p-locate</a> 121ms (from cache)<br> 500 http fetch GET 304 <a href="https://registry.npmjs.org/memory-pager" rel="nofollow">https://registry.npmjs.org/memory-pager</a> 103ms (from cache)<br> 501 silly pacote range manifest for path-exists@^3.0.0 fetched in 124ms<br> 502 silly pacote range manifest for p-locate@^2.0.0 fetched in 136ms<br> 503 silly pacote range manifest for memory-pager@^1.0.2 fetched in 114ms<br> 504 silly pacote range manifest for signal-exit@^3.0.0 fetched in 10ms<br> 505 http fetch GET 304 <a href="https://registry.npmjs.org/ansi-regex" rel="nofollow">https://registry.npmjs.org/ansi-regex</a> 109ms (from cache)<br> 506 http fetch GET 304 <a href="https://registry.npmjs.org/cross-spawn" rel="nofollow">https://registry.npmjs.org/cross-spawn</a> 99ms (from cache)<br> 507 silly pacote range manifest for ansi-regex@^3.0.0 fetched in 115ms<br> 508 silly pacote range manifest for cross-spawn@^6.0.0 fetched in 105ms<br> 509 http fetch GET 304 <a href="https://registry.npmjs.org/get-stream" rel="nofollow">https://registry.npmjs.org/get-stream</a> 114ms (from cache)<br> 510 http fetch GET 304 <a href="https://registry.npmjs.org/is-stream" rel="nofollow">https://registry.npmjs.org/is-stream</a> 95ms (from cache)<br> 511 silly pacote range manifest for get-stream@^4.0.0 fetched in 124ms<br> 512 silly pacote range manifest for is-stream@^1.1.0 fetched in 106ms<br> 513 http fetch GET 304 <a href="https://registry.npmjs.org/npm-run-path" rel="nofollow">https://registry.npmjs.org/npm-run-path</a> 95ms (from cache)<br> 514 silly pacote range manifest for npm-run-path@^2.0.0 fetched in 105ms<br> 515 http fetch GET 304 <a href="https://registry.npmjs.org/p-finally" rel="nofollow">https://registry.npmjs.org/p-finally</a> 104ms (from cache)<br> 516 silly pacote range manifest for p-finally@^1.0.0 fetched in 113ms<br> 517 http fetch GET 304 <a href="https://registry.npmjs.org/strip-eof" rel="nofollow">https://registry.npmjs.org/strip-eof</a> 98ms (from cache)<br> 518 silly pacote range manifest for strip-eof@^1.0.0 fetched in 104ms<br> 519 silly pacote range manifest for is-extendable@^1.0.1 fetched in 9ms<br> 520 http fetch GET 304 <a href="https://registry.npmjs.org/invert-kv" rel="nofollow">https://registry.npmjs.org/invert-kv</a> 109ms (from cache)<br> 521 http fetch GET 304 <a href="https://registry.npmjs.org/map-age-cleaner" rel="nofollow">https://registry.npmjs.org/map-age-cleaner</a> 105ms (from cache)<br> 522 silly pacote range manifest for invert-kv@^2.0.0 fetched in 117ms<br> 523 silly pacote range manifest for map-age-cleaner@^0.1.1 fetched in 114ms<br> 524 http fetch GET 304 <a href="https://registry.npmjs.org/mimic-fn" rel="nofollow">https://registry.npmjs.org/mimic-fn</a> 95ms (from cache)<br> 525 silly pacote range manifest for mimic-fn@^2.0.0 fetched in 102ms<br> 526 http fetch GET 304 <a href="https://registry.npmjs.org/p-is-promise" rel="nofollow">https://registry.npmjs.org/p-is-promise</a> 101ms (from cache)<br> 527 http fetch GET 304 <a href="https://registry.npmjs.org/is-descriptor" rel="nofollow">https://registry.npmjs.org/is-descriptor</a> 89ms (from cache)<br> 528 silly pacote range manifest for p-is-promise@^2.0.0 fetched in 110ms<br> 529 silly pacote range manifest for is-descriptor@^0.1.0 fetched in 94ms<br> 530 http fetch GET 304 <a href="https://registry.npmjs.org/is-descriptor" rel="nofollow">https://registry.npmjs.org/is-descriptor</a> 82ms (from cache)<br> 531 http fetch GET 304 <a href="https://registry.npmjs.org/kind-of" rel="nofollow">https://registry.npmjs.org/kind-of</a> 97ms (from cache)<br> 532 silly pacote range manifest for is-descriptor@^1.0.0 fetched in 87ms<br> 533 silly pacote range manifest for kind-of@^3.0.2 fetched in 103ms<br> 534 http fetch GET 304 <a href="https://registry.npmjs.org/assign-symbols" rel="nofollow">https://registry.npmjs.org/assign-symbols</a> 86ms (from cache)<br> 535 silly pacote range manifest for assign-symbols@^1.0.0 fetched in 93ms<br> 536 http fetch GET 304 <a href="https://registry.npmjs.org/is-descriptor" rel="nofollow">https://registry.npmjs.org/is-descriptor</a> 87ms (from cache)<br> 537 http fetch GET 304 <a href="https://registry.npmjs.org/cache-base" rel="nofollow">https://registry.npmjs.org/cache-base</a> 84ms (from cache)<br> 538 silly pacote range manifest for is-descriptor@^1.0.2 fetched in 96ms<br> 539 silly pacote range manifest for cache-base@^1.0.1 fetched in 90ms<br> 540 http fetch GET 304 <a href="https://registry.npmjs.org/class-utils" rel="nofollow">https://registry.npmjs.org/class-utils</a> 87ms (from cache)<br> 541 silly pacote range manifest for class-utils@^0.3.5 fetched in 99ms<br> 542 http fetch GET 304 <a href="https://registry.npmjs.org/mixin-deep" rel="nofollow">https://registry.npmjs.org/mixin-deep</a> 82ms (from cache)<br> 543 http fetch GET 304 <a href="https://registry.npmjs.org/component-emitter" rel="nofollow">https://registry.npmjs.org/component-emitter</a> 99ms (from cache)<br> 544 silly pacote range manifest for mixin-deep@^1.2.0 fetched in 92ms<br> 545 silly pacote range manifest for component-emitter@^1.2.1 fetched in 109ms<br> 546 silly pacote range manifest for kind-of@^3.2.0 fetched in 5ms<br> 547 http fetch GET 304 <a href="https://registry.npmjs.org/pascalcase" rel="nofollow">https://registry.npmjs.org/pascalcase</a> 98ms (from cache)<br> 548 silly pacote range manifest for pascalcase@^0.1.1 fetched in 104ms<br> 549 http fetch GET 200 <a href="https://registry.npmjs.org/ret" rel="nofollow">https://registry.npmjs.org/ret</a> 10ms (from cache)<br> 550 http fetch GET 304 <a href="https://registry.npmjs.org/atob" rel="nofollow">https://registry.npmjs.org/atob</a> 96ms (from cache)<br> 551 http fetch GET 304 <a href="https://registry.npmjs.org/decode-uri-component" rel="nofollow">https://registry.npmjs.org/decode-uri-component</a> 97ms (from cache)<br> 552 silly pacote range manifest for ret@~0.1.10 fetched in 16ms<br> 553 silly pacote range manifest for atob@^2.1.2 fetched in 103ms<br> 554 silly pacote range manifest for decode-uri-component@^0.2.0 fetched in 103ms<br> 555 silly pacote range manifest for iconv-lite@^0.4.4 fetched in 5ms<br> 556 http fetch GET 304 <a href="https://registry.npmjs.org/resolve-url" rel="nofollow">https://registry.npmjs.org/resolve-url</a> 80ms (from cache)<br> 557 silly pacote range manifest for resolve-url@^0.2.1 fetched in 93ms<br> 558 http fetch GET 304 <a href="https://registry.npmjs.org/source-map-url" rel="nofollow">https://registry.npmjs.org/source-map-url</a> 94ms (from cache)<br> 559 silly pacote range manifest for source-map-url@^0.4.0 fetched in 97ms<br> 560 http fetch GET 304 <a href="https://registry.npmjs.org/osenv" rel="nofollow">https://registry.npmjs.org/osenv</a> 85ms (from cache)<br> 561 http fetch GET 304 <a href="https://registry.npmjs.org/glob" rel="nofollow">https://registry.npmjs.org/glob</a> 70ms (from cache)<br> 562 http fetch GET 304 <a href="https://registry.npmjs.org/urix" rel="nofollow">https://registry.npmjs.org/urix</a> 100ms (from cache)<br> 563 silly pacote range manifest for osenv@^0.1.4 fetched in 92ms<br> 564 silly pacote range manifest for glob@^7.1.3 fetched in 79ms<br> 565 silly pacote range manifest for urix@^0.1.0 fetched in 109ms<br> 566 http fetch GET 304 <a href="https://registry.npmjs.org/minimist" rel="nofollow">https://registry.npmjs.org/minimist</a> 71ms (from cache)<br> 567 silly pacote range manifest for ini@~1.3.0 fetched in 9ms<br> 568 silly pacote version manifest for [email protected] fetched in 85ms<br> 569 silly pacote range manifest for cross-spawn@^5.0.1 fetched in 13ms<br> 570 silly pacote range manifest for get-stream@^3.0.0 fetched in 5ms<br> 571 http fetch GET 304 <a href="https://registry.npmjs.org/ignore-walk" rel="nofollow">https://registry.npmjs.org/ignore-walk</a> 94ms (from cache)<br> 572 silly pacote range manifest for ignore-walk@^3.0.1 fetched in 96ms<br> 573 http fetch GET 304 <a href="https://registry.npmjs.org/npm-bundled" rel="nofollow">https://registry.npmjs.org/npm-bundled</a> 91ms (from cache)<br> 574 silly pacote range manifest for npm-bundled@^1.0.1 fetched in 98ms<br> 575 http fetch GET 304 <a href="https://registry.npmjs.org/sax" rel="nofollow">https://registry.npmjs.org/sax</a> 111ms (from cache)<br> 576 http fetch GET 304 <a href="https://registry.npmjs.org/npm-normalize-package-bin" rel="nofollow">https://registry.npmjs.org/npm-normalize-package-bin</a> 95ms (from cache)<br> 577 silly pacote range manifest for set-blocking@~2.0.0 fetched in 7ms<br> 578 silly pacote range manifest for sax@^1.2.4 fetched in 117ms<br> 579 silly pacote range manifest for npm-normalize-package-bin@^1.0.1 fetched in 102ms<br> 580 http fetch GET 304 <a href="https://registry.npmjs.org/deep-extend" rel="nofollow">https://registry.npmjs.org/deep-extend</a> 78ms (from cache)<br> 581 silly pacote range manifest for deep-extend@^0.6.0 fetched in 92ms<br> 582 http fetch GET 304 <a href="https://registry.npmjs.org/strip-json-comments" rel="nofollow">https://registry.npmjs.org/strip-json-comments</a> 90ms (from cache)<br> 583 http fetch GET 304 <a href="https://registry.npmjs.org/minimist" rel="nofollow">https://registry.npmjs.org/minimist</a> 94ms (from cache)<br> 584 silly pacote range manifest for strip-json-comments@~2.0.1 fetched in 94ms<br> 585 silly pacote range manifest for minimist@^1.2.0 fetched in 97ms<br> 586 silly pacote range manifest for mkdirp@^0.5.0 fetched in 4ms<br> 587 http fetch GET 304 <a href="https://registry.npmjs.org/console-control-strings" rel="nofollow">https://registry.npmjs.org/console-control-strings</a> 77ms (from cache)<br> 588 http fetch GET 304 <a href="https://registry.npmjs.org/are-we-there-yet" rel="nofollow">https://registry.npmjs.org/are-we-there-yet</a> 81ms (from cache)<br> 589 silly pacote range manifest for safe-buffer@~5.1.0 fetched in 4ms<br> 590 http fetch GET 304 <a href="https://registry.npmjs.org/gauge" rel="nofollow">https://registry.npmjs.org/gauge</a> 66ms (from cache)<br> 591 silly pacote range manifest for console-control-strings@~1.1.0 fetched in 82ms<br> 592 silly pacote range manifest for are-we-there-yet@~1.1.2 fetched in 88ms<br> 593 silly pacote range manifest for rc@^1.0.1 fetched in 4ms<br> 594 silly pacote range manifest for gauge@~2.7.3 fetched in 72ms<br> 595 silly pacote range manifest for rc@^1.1.6 fetched in 8ms<br> 596 http fetch GET 304 <a href="https://registry.npmjs.org/minipass" rel="nofollow">https://registry.npmjs.org/minipass</a> 89ms (from cache)<br> 597 silly pacote range manifest for minipass@^2.8.6 fetched in 94ms<br> 598 http fetch GET 304 <a href="https://registry.npmjs.org/minizlib" rel="nofollow">https://registry.npmjs.org/minizlib</a> 85ms (from cache)<br> 599 http fetch GET 304 <a href="https://registry.npmjs.org/fs-minipass" rel="nofollow">https://registry.npmjs.org/fs-minipass</a> 106ms (from cache)<br> 600 http fetch GET 304 <a href="https://registry.npmjs.org/yallist" rel="nofollow">https://registry.npmjs.org/yallist</a> 75ms (from cache)<br> 601 silly pacote range manifest for minizlib@^1.2.1 fetched in 95ms<br> 602 silly pacote range manifest for fs-minipass@^1.2.5 fetched in 116ms<br> 603 http fetch GET 304 <a href="https://registry.npmjs.org/chownr" rel="nofollow">https://registry.npmjs.org/chownr</a> 117ms (from cache)<br> 604 silly pacote range manifest for yallist@^3.0.3 fetched in 83ms<br> 605 http fetch GET 304 <a href="https://registry.npmjs.org/color-name" rel="nofollow">https://registry.npmjs.org/color-name</a> 76ms (from cache)<br> 606 silly pacote range manifest for chownr@^1.1.1 fetched in 127ms<br> 607 silly pacote range manifest for is-stream@^1.0.0 fetched in 10ms<br> 608 silly pacote version manifest for [email protected] fetched in 84ms<br> 609 http fetch GET 304 <a href="https://registry.npmjs.org/create-error-class" rel="nofollow">https://registry.npmjs.org/create-error-class</a> 97ms (from cache)<br> 610 http fetch GET 304 <a href="https://registry.npmjs.org/is-redirect" rel="nofollow">https://registry.npmjs.org/is-redirect</a> 89ms (from cache)<br> 611 http fetch GET 304 <a href="https://registry.npmjs.org/duplexer3" rel="nofollow">https://registry.npmjs.org/duplexer3</a> 96ms (from cache)<br> 612 silly pacote range manifest for create-error-class@^3.0.0 fetched in 100ms<br> 613 silly pacote range manifest for is-redirect@^1.0.0 fetched in 93ms<br> 614 silly pacote range manifest for duplexer3@^0.1.4 fetched in 99ms<br> 615 silly pacote range manifest for is-fullwidth-code-point@^1.0.0 fetched in 3ms<br> 616 silly pacote range manifest for strip-ansi@^3.0.0 fetched in 2ms<br> 617 silly pacote range manifest for ansi-regex@^2.0.0 fetched in 3ms<br> 618 http fetch GET 304 <a href="https://registry.npmjs.org/timed-out" rel="nofollow">https://registry.npmjs.org/timed-out</a> 90ms (from cache)<br> 619 http fetch GET 304 <a href="https://registry.npmjs.org/lowercase-keys" rel="nofollow">https://registry.npmjs.org/lowercase-keys</a> 98ms (from cache)<br> 620 http fetch GET 304 <a href="https://registry.npmjs.org/url-parse-lax" rel="nofollow">https://registry.npmjs.org/url-parse-lax</a> 86ms (from cache)<br> 621 silly pacote range manifest for timed-out@^4.0.0 fetched in 96ms<br> 622 http fetch GET 304 <a href="https://registry.npmjs.org/unzip-response" rel="nofollow">https://registry.npmjs.org/unzip-response</a> 97ms (from cache)<br> 623 silly pacote range manifest for lowercase-keys@^1.0.0 fetched in 109ms<br> 624 silly pacote range manifest for url-parse-lax@^1.0.0 fetched in 97ms<br> 625 silly pacote range manifest for semver@^5.5.0 fetched in 12ms<br> 626 http fetch GET 304 <a href="https://registry.npmjs.org/code-point-at" rel="nofollow">https://registry.npmjs.org/code-point-at</a> 100ms (from cache)<br> 627 silly pacote range manifest for unzip-response@^2.0.1 fetched in 107ms<br> 628 http fetch GET 304 <a href="https://registry.npmjs.org/is-retry-allowed" rel="nofollow">https://registry.npmjs.org/is-retry-allowed</a> 135ms (from cache)<br> 629 silly pacote range manifest for code-point-at@^1.0.0 fetched in 113ms<br> 630 silly pacote range manifest for is-retry-allowed@^1.0.0 fetched in 149ms<br> 631 http fetch GET 304 <a href="https://registry.npmjs.org/p-limit" rel="nofollow">https://registry.npmjs.org/p-limit</a> 94ms (from cache)<br> 632 http fetch GET 200 <a href="https://registry.npmjs.org/which" rel="nofollow">https://registry.npmjs.org/which</a> 21ms (from cache)<br> 633 http fetch GET 304 <a href="https://registry.npmjs.org/nice-try" rel="nofollow">https://registry.npmjs.org/nice-try</a> 102ms (from cache)<br> 634 silly pacote range manifest for p-limit@^1.1.0 fetched in 107ms<br> 635 silly pacote range manifest for which@^1.2.9 fetched in 35ms<br> 636 silly pacote range manifest for nice-try@^1.0.4 fetched in 112ms<br> 637 silly pacote range manifest for kind-of@^5.0.0 fetched in 5ms<br> 638 http fetch GET 304 <a href="https://registry.npmjs.org/path-key" rel="nofollow">https://registry.npmjs.org/path-key</a> 124ms (from cache)<br> 639 silly pacote range manifest for path-key@^2.0.1 fetched in 127ms<br> 640 http fetch GET 304 <a href="https://registry.npmjs.org/pump" rel="nofollow">https://registry.npmjs.org/pump</a> 70ms (from cache)<br> 641 silly pacote range manifest for pump@^3.0.0 fetched in 79ms<br> 642 http fetch GET 304 <a href="https://registry.npmjs.org/path-key" rel="nofollow">https://registry.npmjs.org/path-key</a> 82ms (from cache)<br> 643 silly pacote range manifest for kind-of@^6.0.2 fetched in 7ms<br> 644 silly pacote range manifest for path-key@^2.0.0 fetched in 94ms<br> 645 http fetch GET 304 <a href="https://registry.npmjs.org/is-plain-object" rel="nofollow">https://registry.npmjs.org/is-plain-object</a> 92ms (from cache)<br> 646 http fetch GET 304 <a href="https://registry.npmjs.org/shebang-command" rel="nofollow">https://registry.npmjs.org/shebang-command</a> 116ms (from cache)<br> 647 silly pacote range manifest for is-plain-object@^2.0.4 fetched in 98ms<br> 648 http fetch GET 304 <a href="https://registry.npmjs.org/p-defer" rel="nofollow">https://registry.npmjs.org/p-defer</a> 99ms (from cache)<br> 649 http fetch GET 304 <a href="https://registry.npmjs.org/is-accessor-descriptor" rel="nofollow">https://registry.npmjs.org/is-accessor-descriptor</a> 86ms (from cache)<br> 650 silly pacote range manifest for shebang-command@^1.2.0 fetched in 121ms<br> 651 silly pacote range manifest for p-defer@^1.0.0 fetched in 104ms<br> 652 silly pacote range manifest for is-accessor-descriptor@^0.1.6 fetched in 92ms<br> 653 http fetch GET 304 <a href="https://registry.npmjs.org/is-accessor-descriptor" rel="nofollow">https://registry.npmjs.org/is-accessor-descriptor</a> 92ms (from cache)<br> 654 http fetch GET 304 <a href="https://registry.npmjs.org/is-data-descriptor" rel="nofollow">https://registry.npmjs.org/is-data-descriptor</a> 103ms (from cache)<br> 655 http fetch GET 304 <a href="https://registry.npmjs.org/is-data-descriptor" rel="nofollow">https://registry.npmjs.org/is-data-descriptor</a> 90ms (from cache)<br> 656 silly pacote range manifest for is-accessor-descriptor@^1.0.0 fetched in 104ms<br> 657 silly pacote range manifest for is-data-descriptor@^0.1.4 fetched in 112ms<br> 658 silly pacote range manifest for is-data-descriptor@^1.0.0 fetched in 99ms<br> 659 http fetch GET 304 <a href="https://registry.npmjs.org/is-buffer" rel="nofollow">https://registry.npmjs.org/is-buffer</a> 97ms (from cache)<br> 660 http fetch GET 304 <a href="https://registry.npmjs.org/collection-visit" rel="nofollow">https://registry.npmjs.org/collection-visit</a> 86ms (from cache)<br> 661 http fetch GET 304 <a href="https://registry.npmjs.org/get-value" rel="nofollow">https://registry.npmjs.org/get-value</a> 79ms (from cache)<br> 662 silly pacote range manifest for is-buffer@^1.1.5 fetched in 108ms<br> 663 silly pacote range manifest for collection-visit@^1.0.0 fetched in 97ms<br> 664 silly pacote range manifest for get-value@^2.0.6 fetched in 87ms<br> 665 http fetch GET 304 <a href="https://registry.npmjs.org/has-value" rel="nofollow">https://registry.npmjs.org/has-value</a> 92ms (from cache)<br> 666 http fetch GET 304 <a href="https://registry.npmjs.org/to-object-path" rel="nofollow">https://registry.npmjs.org/to-object-path</a> 88ms (from cache)<br> 667 silly pacote range manifest for has-value@^1.0.0 fetched in 100ms<br> 668 silly pacote range manifest for to-object-path@^0.3.0 fetched in 96ms<br> 669 http fetch GET 304 <a href="https://registry.npmjs.org/set-value" rel="nofollow">https://registry.npmjs.org/set-value</a> 122ms (from cache)<br> 670 http fetch GET 200 <a href="https://registry.npmjs.org/fs.realpath" rel="nofollow">https://registry.npmjs.org/fs.realpath</a> 25ms (from cache)<br> 671 http fetch GET 304 <a href="https://registry.npmjs.org/union-value" rel="nofollow">https://registry.npmjs.org/union-value</a> 106ms (from cache)<br> 672 silly pacote range manifest for set-value@^2.0.0 fetched in 130ms<br> 673 silly pacote range manifest for fs.realpath@^1.0.0 fetched in 32ms<br> 674 silly pacote range manifest for union-value@^1.0.0 fetched in 115ms<br> 675 http fetch GET 304 <a href="https://registry.npmjs.org/arr-union" rel="nofollow">https://registry.npmjs.org/arr-union</a> 109ms (from cache)<br> 676 silly pacote range manifest for inherits@2 fetched in 9ms<br> 677 http fetch GET 304 <a href="https://registry.npmjs.org/unset-value" rel="nofollow">https://registry.npmjs.org/unset-value</a> 120ms (from cache)<br> 678 silly pacote range manifest for arr-union@^3.1.0 fetched in 120ms<br> 679 silly pacote range manifest for unset-value@^1.0.0 fetched in 130ms<br> 680 silly pacote range manifest for readable-stream@^2.0.6 fetched in 4ms<br> 681 http fetch GET 304 <a href="https://registry.npmjs.org/os-homedir" rel="nofollow">https://registry.npmjs.org/os-homedir</a> 90ms (from cache)<br> 682 http fetch GET 304 <a href="https://registry.npmjs.org/for-in" rel="nofollow">https://registry.npmjs.org/for-in</a> 96ms (from cache)<br> 683 http fetch GET 304 <a href="https://registry.npmjs.org/static-extend" rel="nofollow">https://registry.npmjs.org/static-extend</a> 99ms (from cache)<br> 684 silly pacote range manifest for os-homedir@^1.0.0 fetched in 94ms<br> 685 silly pacote range manifest for for-in@^1.0.2 fetched in 101ms<br> 686 silly pacote range manifest for static-extend@^0.1.1 fetched in 104ms<br> 687 silly pacote range manifest for console-control-strings@^1.0.0 fetched in 5ms<br> 688 http fetch GET 200 <a href="https://registry.npmjs.org/object-assign" rel="nofollow">https://registry.npmjs.org/object-assign</a> 22ms (from cache)<br> 689 http fetch GET 304 <a href="https://registry.npmjs.org/os-tmpdir" rel="nofollow">https://registry.npmjs.org/os-tmpdir</a> 118ms (from cache)<br> 690 silly pacote range manifest for object-assign@^4.1.0 fetched in 35ms<br> 691 silly pacote range manifest for os-tmpdir@^1.0.0 fetched in 130ms<br> 692 silly pacote range manifest for yallist@^3.0.0 fetched in 9ms<br> 693 silly pacote range manifest for minipass@^2.9.0 fetched in 5ms<br> 694 silly pacote range manifest for minipass@^2.6.0 fetched in 5ms<br> 695 http fetch GET 304 <a href="https://registry.npmjs.org/lru-cache" rel="nofollow">https://registry.npmjs.org/lru-cache</a> 101ms (from cache)<br> 696 silly pacote range manifest for lru-cache@^4.0.1 fetched in 104ms<br> 697 http fetch GET 304 <a href="https://registry.npmjs.org/delegates" rel="nofollow">https://registry.npmjs.org/delegates</a> 100ms (from cache)<br> 698 http fetch GET 304 <a href="https://registry.npmjs.org/inflight" rel="nofollow">https://registry.npmjs.org/inflight</a> 121ms (from cache)<br> 699 silly pacote range manifest for delegates@^1.0.0 fetched in 107ms<br> 700 http fetch GET 304 <a href="https://registry.npmjs.org/aproba" rel="nofollow">https://registry.npmjs.org/aproba</a> 95ms (from cache)<br> 701 http fetch GET 304 <a href="https://registry.npmjs.org/once" rel="nofollow">https://registry.npmjs.org/once</a> 118ms (from cache)<br> 702 silly pacote range manifest for inflight@^1.0.4 fetched in 128ms<br> 703 silly pacote range manifest for aproba@^1.0.3 fetched in 103ms<br> 704 http fetch GET 304 <a href="https://registry.npmjs.org/has-unicode" rel="nofollow">https://registry.npmjs.org/has-unicode</a> 88ms (from cache)<br> 705 silly pacote range manifest for once@^1.3.0 fetched in 133ms<br> 706 silly pacote range manifest for has-unicode@^2.0.0 fetched in 98ms<br> 707 silly pacote range manifest for once@^1.3.1 fetched in 5ms<br> 708 silly pacote range manifest for kind-of@^6.0.0 fetched in 4ms<br> 709 http fetch GET 304 <a href="https://registry.npmjs.org/wide-align" rel="nofollow">https://registry.npmjs.org/wide-align</a> 111ms (from cache)<br> 710 silly pacote range manifest for wide-align@^1.1.0 fetched in 113ms<br> 711 http fetch GET 304 <a href="https://registry.npmjs.org/number-is-nan" rel="nofollow">https://registry.npmjs.org/number-is-nan</a> 69ms (from cache)<br> 712 silly pacote range manifest for number-is-nan@^1.0.0 fetched in 71ms<br> 713 http fetch GET 304 <a href="https://registry.npmjs.org/capture-stack-trace" rel="nofollow">https://registry.npmjs.org/capture-stack-trace</a> 72ms (from cache)<br> 714 silly pacote range manifest for capture-stack-trace@^1.0.0 fetched in 77ms<br> 715 silly pacote range manifest for is-extendable@^0.1.1 fetched in 7ms<br> 716 silly pacote range manifest for is-plain-object@^2.0.3 fetched in 8ms<br> 717 http fetch GET 304 <a href="https://registry.npmjs.org/p-try" rel="nofollow">https://registry.npmjs.org/p-try</a> 81ms (from cache)<br> 718 silly pacote range manifest for split-string@^3.0.1 fetched in 11ms<br> 719 silly pacote range manifest for p-try@^1.0.0 fetched in 89ms<br> 720 silly pacote range manifest for set-value@^2.0.1 fetched in 7ms<br> 721 silly pacote range manifest for has-value@^0.3.1 fetched in 10ms<br> 722 http fetch GET 304 <a href="https://registry.npmjs.org/shebang-regex" rel="nofollow">https://registry.npmjs.org/shebang-regex</a> 87ms (from cache)<br> 723 silly pacote range manifest for shebang-regex@^1.0.0 fetched in 95ms<br> 724 silly pacote range manifest for yallist@^2.1.2 fetched in 4ms<br> 725 http fetch GET 304 <a href="https://registry.npmjs.org/map-visit" rel="nofollow">https://registry.npmjs.org/map-visit</a> 95ms (from cache)<br> 726 http fetch GET 304 <a href="https://registry.npmjs.org/end-of-stream" rel="nofollow">https://registry.npmjs.org/end-of-stream</a> 114ms (from cache)<br> 727 http fetch GET 304 <a href="https://registry.npmjs.org/prepend-http" rel="nofollow">https://registry.npmjs.org/prepend-http</a> 131ms (from cache)<br> 728 http fetch GET 304 <a href="https://registry.npmjs.org/object-visit" rel="nofollow">https://registry.npmjs.org/object-visit</a> 83ms (from cache)<br> 729 silly pacote range manifest for map-visit@^1.0.0 fetched in 100ms<br> 730 silly pacote range manifest for prepend-http@^1.0.1 fetched in 137ms<br> 731 silly pacote range manifest for end-of-stream@^1.1.0 fetched in 121ms<br> 732 silly pacote range manifest for object-visit@^1.0.0 fetched in 90ms<br> 733 http fetch GET 304 <a href="https://registry.npmjs.org/has-values" rel="nofollow">https://registry.npmjs.org/has-values</a> 80ms (from cache)<br> 734 silly pacote range manifest for string-width@^1.0.2 || 2 fetched in 7ms<br> 735 silly pacote range manifest for get-value@^2.0.3 fetched in 3ms<br> 736 http fetch GET 200 <a href="https://registry.npmjs.org/wrappy" rel="nofollow">https://registry.npmjs.org/wrappy</a> 13ms (from cache)<br> 737 silly pacote range manifest for has-values@^1.0.0 fetched in 84ms<br> 738 silly pacote range manifest for has-values@^0.1.4 fetched in 6ms<br> 739 silly pacote range manifest for isobject@^2.0.0 fetched in 6ms<br> 740 silly pacote range manifest for once@^1.4.0 fetched in 6ms<br> 741 silly pacote range manifest for wrappy@1 fetched in 19ms<br> 742 silly pacote range manifest for kind-of@^4.0.0 fetched in 5ms<br> 743 silly pacote version manifest for [email protected] fetched in 4ms<br> 744 http fetch GET 304 <a href="https://registry.npmjs.org/isexe" rel="nofollow">https://registry.npmjs.org/isexe</a> 140ms (from cache)<br> 745 silly pacote range manifest for isexe@^2.0.0 fetched in 144ms<br> 746 http fetch GET 304 <a href="https://registry.npmjs.org/object-copy" rel="nofollow">https://registry.npmjs.org/object-copy</a> 57ms (from cache)<br> 747 silly pacote range manifest for object-copy@^0.1.0 fetched in 59ms<br> 748 http fetch GET 304 <a href="https://registry.npmjs.org/pseudomap" rel="nofollow">https://registry.npmjs.org/pseudomap</a> 55ms (from cache)<br> 749 silly pacote range manifest for kind-of@^3.0.3 fetched in 3ms<br> 750 silly pacote range manifest for pseudomap@^1.0.2 fetched in 58ms<br> 751 http fetch GET 304 <a href="https://registry.npmjs.org/copy-descriptor" rel="nofollow">https://registry.npmjs.org/copy-descriptor</a> 37ms (from cache)<br> 752 silly pacote range manifest for copy-descriptor@^0.1.0 fetched in 38ms<br> 753 error cb() never called!<br> 754 error This is an error with npm itself. Please report this error at:<br> 755 error <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></p>
<h3 dir="auto">Is there an existing issue for this?</h3> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the existing issues</li> </ul> <h3 dir="auto">Current Behavior</h3> <p dir="auto">I find no way to install anything from a private registry.<br> I associated our scope with a registry, but then it gets completely ignored by NPM.</p> <h3 dir="auto">Expected Behavior</h3> <p dir="auto">NPM should install the package from a registry associated with the scope.</p> <h3 dir="auto">Steps To Reproduce</h3> <p dir="auto">First I associate a scope with a registry (<a href="https://docs.npmjs.com/cli/v7/using-npm/scope#associating-a-scope-with-a-registry" rel="nofollow">https://docs.npmjs.com/cli/v7/using-npm/scope#associating-a-scope-with-a-registry</a>)</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ npm config set @ourscope:registry http://gitlab.our.domain/api/v4/packages/npm/"><pre class="notranslate"><code class="notranslate">$ npm config set @ourscope:registry http://gitlab.our.domain/api/v4/packages/npm/ </code></pre></div> <p dir="auto">It updates <code class="notranslate">~/.npmrc</code> file and <code class="notranslate">npm config ls</code> confirms that the changes is accepted.</p> <p dir="auto">But afterwards there's no way to install anything for that repo. Specifically:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ npm i @ourscope/a-package --verbose"><pre class="notranslate"><code class="notranslate">$ npm i @ourscope/a-package --verbose </code></pre></div> <p dir="auto">shows that the first request goes to npmjs.com which returns 404:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ npm i @ourscope/a-package --verbose npm verb cli [ npm verb cli '/home/user/.nvm/versions/node/v14.16.1/bin/node', npm verb cli '/home/user/.nvm/versions/node/v14.16.1/bin/npm', npm verb cli 'i', npm verb cli '@ourscope/a-package', npm verb cli '--verbose' npm verb cli ] npm info using [email protected] npm info using [email protected] npm timing npm:load:whichnode Completed in 0ms npm timing config:load:defaults Completed in 1ms npm timing config:load:file:/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/npmrc Completed in 2ms npm timing config:load:builtin Completed in 2ms npm timing config:load:cli Completed in 3ms npm timing config:load:env Completed in 0ms npm timing config:load:file:/projects/ourscope/lib/a-package-2/.npmrc Completed in 2ms npm timing config:load:project Completed in 3ms npm timing config:load:file:/home/user/.npmrc Completed in 0ms npm timing config:load:user Completed in 0ms npm timing config:load:file:/home/user/.nvm/versions/node/v14.16.1/etc/npmrc Completed in 0ms npm timing config:load:global Completed in 0ms npm timing config:load:validate Completed in 1ms npm timing config:load:credentials Completed in 1ms npm timing config:load:setEnvs Completed in 1ms npm timing config:load Completed in 12ms npm timing npm:load:configload Completed in 12ms npm timing npm:load:setTitle Completed in 0ms npm timing npm:load:setupLog Completed in 1ms npm timing npm:load:cleanupLog Completed in 2ms npm timing npm:load:configScope Completed in 0ms npm timing npm:load:projectScope Completed in 0ms npm timing npm:load Completed in 18ms npm timing config:load:flatten Completed in 2ms npm timing arborist:ctor Completed in 0ms npm timing arborist:ctor Completed in 1ms npm timing idealTree:init Completed in 10ms npm timing idealTree:userRequests Completed in 2ms npm http fetch GET 404 https://registry.npmjs.org/@ourscope/a-package 1492ms (cache skip) npm http fetch GET 404 https://registry.npmjs.org/@ourscope/a-package 933ms (cache skip) npm timing idealTree:#root Completed in 2448ms npm timing idealTree:node_modules/@ourscope/a-package Completed in 0ms npm timing idealTree:buildDeps Completed in 2452ms npm timing idealTree:fixDepFlags Completed in 2ms npm timing idealTree Completed in 2471ms npm timing command:install Completed in 2489ms npm verb stack HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/@ourscope/a-package - Not found npm verb stack at /home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:95:15 npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5) npm verb stack at async Arborist.[nodeFromEdge] (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:940:19) npm verb stack at async Arborist.[buildDepStep] (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:886:11) npm verb stack at async Arborist.buildIdealTree (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7) npm verb stack at async Promise.all (index 1) npm verb stack at async Arborist.reify (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:134:5) npm verb stack at async Install.install (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/lib/install.js:150:5) npm verb statusCode 404 npm verb pkgid @ourscope/a-package@* npm verb cwd /projects/ourscope/lib/a-package-2 npm verb Linux 5.4.0-77-generic npm verb argv &quot;/home/user/.nvm/versions/node/v14.16.1/bin/node&quot; &quot;/home/user/.nvm/versions/node/v14.16.1/bin/npm&quot; &quot;i&quot; &quot;@ourscope/a-package&quot; &quot;--verbose&quot; npm verb node v14.16.1 npm verb npm v7.20.0 npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@ourscope/a-package - Not found npm ERR! 404 npm ERR! 404 '@ourscope/a-package@*' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm verb exit 1 npm timing npm Completed in 2694ms"><pre class="notranslate"><code class="notranslate">$ npm i @ourscope/a-package --verbose npm verb cli [ npm verb cli '/home/user/.nvm/versions/node/v14.16.1/bin/node', npm verb cli '/home/user/.nvm/versions/node/v14.16.1/bin/npm', npm verb cli 'i', npm verb cli '@ourscope/a-package', npm verb cli '--verbose' npm verb cli ] npm info using [email protected] npm info using [email protected] npm timing npm:load:whichnode Completed in 0ms npm timing config:load:defaults Completed in 1ms npm timing config:load:file:/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/npmrc Completed in 2ms npm timing config:load:builtin Completed in 2ms npm timing config:load:cli Completed in 3ms npm timing config:load:env Completed in 0ms npm timing config:load:file:/projects/ourscope/lib/a-package-2/.npmrc Completed in 2ms npm timing config:load:project Completed in 3ms npm timing config:load:file:/home/user/.npmrc Completed in 0ms npm timing config:load:user Completed in 0ms npm timing config:load:file:/home/user/.nvm/versions/node/v14.16.1/etc/npmrc Completed in 0ms npm timing config:load:global Completed in 0ms npm timing config:load:validate Completed in 1ms npm timing config:load:credentials Completed in 1ms npm timing config:load:setEnvs Completed in 1ms npm timing config:load Completed in 12ms npm timing npm:load:configload Completed in 12ms npm timing npm:load:setTitle Completed in 0ms npm timing npm:load:setupLog Completed in 1ms npm timing npm:load:cleanupLog Completed in 2ms npm timing npm:load:configScope Completed in 0ms npm timing npm:load:projectScope Completed in 0ms npm timing npm:load Completed in 18ms npm timing config:load:flatten Completed in 2ms npm timing arborist:ctor Completed in 0ms npm timing arborist:ctor Completed in 1ms npm timing idealTree:init Completed in 10ms npm timing idealTree:userRequests Completed in 2ms npm http fetch GET 404 https://registry.npmjs.org/@ourscope/a-package 1492ms (cache skip) npm http fetch GET 404 https://registry.npmjs.org/@ourscope/a-package 933ms (cache skip) npm timing idealTree:#root Completed in 2448ms npm timing idealTree:node_modules/@ourscope/a-package Completed in 0ms npm timing idealTree:buildDeps Completed in 2452ms npm timing idealTree:fixDepFlags Completed in 2ms npm timing idealTree Completed in 2471ms npm timing command:install Completed in 2489ms npm verb stack HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/@ourscope/a-package - Not found npm verb stack at /home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:95:15 npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5) npm verb stack at async Arborist.[nodeFromEdge] (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:940:19) npm verb stack at async Arborist.[buildDepStep] (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:886:11) npm verb stack at async Arborist.buildIdealTree (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:218:7) npm verb stack at async Promise.all (index 1) npm verb stack at async Arborist.reify (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:134:5) npm verb stack at async Install.install (/home/user/.nvm/versions/node/v14.16.1/lib/node_modules/npm/lib/install.js:150:5) npm verb statusCode 404 npm verb pkgid @ourscope/a-package@* npm verb cwd /projects/ourscope/lib/a-package-2 npm verb Linux 5.4.0-77-generic npm verb argv "/home/user/.nvm/versions/node/v14.16.1/bin/node" "/home/user/.nvm/versions/node/v14.16.1/bin/npm" "i" "@ourscope/a-package" "--verbose" npm verb node v14.16.1 npm verb npm v7.20.0 npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@ourscope/a-package - Not found npm ERR! 404 npm ERR! 404 '@ourscope/a-package@*' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm verb exit 1 npm timing npm Completed in 2694ms </code></pre></div> <p dir="auto">Even if I pass <code class="notranslate">--registry</code> param via command line, it doesn't make any difference and NPM sends request to npmjs.com instead.</p> <h3 dir="auto">Environment</h3> <ul dir="auto"> <li>OS: Ubuntu 20.04</li> <li>Node: 14.x</li> <li>npm: 7.20.0</li> </ul>
0
<p dir="auto">Slow tokenizers:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import transformers &gt;&gt;&gt; t_slow = transformers.AutoTokenizer.from_pretrained(&quot;roberta-base&quot;, use_fast=False) &gt;&gt;&gt; t_slow.encode_plus(&quot;A &lt;mask&gt; sentence.&quot;) {'input_ids': [0, 83, 50264, 3645, 4, 2], 'token_type_ids': [0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1]} &gt;&gt;&gt; t_slow.convert_ids_to_tokens([0, 83, 50264, 3645, 4, 2]) ['&lt;s&gt;', 'ĠA', '&lt;mask&gt;', 'Ġsentence', '.', '&lt;/s&gt;']"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import transformers &gt;&gt;&gt; t_slow = transformers.AutoTokenizer.from_pretrained("roberta-base", use_fast=False) &gt;&gt;&gt; t_slow.encode_plus("A &lt;mask&gt; sentence.") {'input_ids': [0, 83, 50264, 3645, 4, 2], 'token_type_ids': [0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1]} &gt;&gt;&gt; t_slow.convert_ids_to_tokens([0, 83, 50264, 3645, 4, 2]) ['&lt;s&gt;', 'ĠA', '&lt;mask&gt;', 'Ġsentence', '.', '&lt;/s&gt;'] </code></pre></div> <p dir="auto">Fast tokenizers:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import transformers &gt;&gt;&gt; t_fast = transformers.AutoTokenizer.from_pretrained(&quot;roberta-base&quot;, use_fast=True) &gt;&gt;&gt; t_fast.encode_plus(&quot;A &lt;mask&gt; sentence.&quot;) {'input_ids': [0, 250, 1437, 50264, 3645, 4, 2], 'token_type_ids': [0, 0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1, 1]} &gt;&gt;&gt; t_fast.convert_ids_to_tokens([0, 250, 1437, 50264, 3645, 4, 2]) ['&lt;s&gt;', 'A', 'Ġ', '&lt;mask&gt;', 'Ġsentence', '.', '&lt;/s&gt;'] "><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import transformers &gt;&gt;&gt; t_fast = transformers.AutoTokenizer.from_pretrained("roberta-base", use_fast=True) &gt;&gt;&gt; t_fast.encode_plus("A &lt;mask&gt; sentence.") {'input_ids': [0, 250, 1437, 50264, 3645, 4, 2], 'token_type_ids': [0, 0, 0, 0, 0, 0, 0], 'attention_mask': [1, 1, 1, 1, 1, 1, 1]} &gt;&gt;&gt; t_fast.convert_ids_to_tokens([0, 250, 1437, 50264, 3645, 4, 2]) ['&lt;s&gt;', 'A', 'Ġ', '&lt;mask&gt;', 'Ġsentence', '.', '&lt;/s&gt;'] </code></pre></div>
<h1 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h1> <h2 dir="auto">Information</h2> <p dir="auto">Model I am using (Bert, XLNet ...): Bert</p> <p dir="auto">Language I am using the model on (English, Chinese ...): English</p> <p dir="auto">The problem arises when using:</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> the official example scripts: (give details below)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> my own modified scripts: (give details below)</li> </ul> <p dir="auto">The tasks I am working on is:</p> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> an official GLUE/SQUaD task: (give the name)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> my own task or dataset: (give details below)</li> </ul> <h2 dir="auto">To reproduce</h2> <p dir="auto">Steps to reproduce the behavior:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from transformers import AutoTokenizer pretrained_model_name = &quot;bert-base-cased&quot; fast_tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name) slow_tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name, use_fast=False) text = &quot;hello&quot; assert fast_tokenizer.encode(text, add_special_tokens=False) == slow_tokenizer.encode(text, add_special_tokens=False)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">transformers</span> <span class="pl-k">import</span> <span class="pl-v">AutoTokenizer</span> <span class="pl-s1">pretrained_model_name</span> <span class="pl-c1">=</span> <span class="pl-s">"bert-base-cased"</span> <span class="pl-s1">fast_tokenizer</span> <span class="pl-c1">=</span> <span class="pl-v">AutoTokenizer</span>.<span class="pl-en">from_pretrained</span>(<span class="pl-s1">pretrained_model_name</span>) <span class="pl-s1">slow_tokenizer</span> <span class="pl-c1">=</span> <span class="pl-v">AutoTokenizer</span>.<span class="pl-en">from_pretrained</span>(<span class="pl-s1">pretrained_model_name</span>, <span class="pl-s1">use_fast</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) <span class="pl-s1">text</span> <span class="pl-c1">=</span> <span class="pl-s">"hello"</span> <span class="pl-k">assert</span> <span class="pl-s1">fast_tokenizer</span>.<span class="pl-en">encode</span>(<span class="pl-s1">text</span>, <span class="pl-s1">add_special_tokens</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) <span class="pl-c1">==</span> <span class="pl-s1">slow_tokenizer</span>.<span class="pl-en">encode</span>(<span class="pl-s1">text</span>, <span class="pl-s1">add_special_tokens</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)</pre></div> <h2 dir="auto">Expected behavior</h2> <p dir="auto">The fast tokenizers shouldn't add the special tokens if <code class="notranslate">add_special_tokens</code> is equal to <code class="notranslate">False</code>.</p> <h2 dir="auto">Environment info</h2> <ul dir="auto"> <li><code class="notranslate">transformers</code> version: 2.5.0</li> <li>Platform: Linux-4.15.0-76-generic-x86_64-with-debian-buster-sid</li> <li>Python version: 3.7.4</li> <li>PyTorch version (GPU?): 1.4.0 (True)</li> <li>Tensorflow version (GPU?): 2.0.0 (False)</li> <li>Using GPU in script?: No</li> <li>Using distributed or parallel set-up in script?: No</li> </ul>
1
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] bug report [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[x] bug report [ ] feature request [ ] support request =&gt; Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre></div> <p dir="auto"><strong>Current behavior</strong></p> <p dir="auto">[(ngModel)] without name is not allowed in a form. This used to work in the previous(now deprecated) forms. I think a mix for template and model driven form in the same template should be allowed. I see the following error when ngModel is used in a form without a associated control.</p> <p dir="auto">Name attribute must be set if ngModel is used within a form.<br> Example: &lt;input [(ngModel)]="person.firstName" name="first"&gt;</p> <p dir="auto"><strong>Expected/desired behavior</strong></p> <p dir="auto">[(ngModel)] should be allowed in a form without an associated control</p> <p dir="auto"><strong>Reproduction of the problem</strong></p> <p dir="auto">You can see the error in the dev console of this plunker<br> <a href="https://plnkr.co/edit/CcXGHjI6jkkW8YpR28ZI?p=preview" rel="nofollow">https://plnkr.co/edit/CcXGHjI6jkkW8YpR28ZI?p=preview</a></p> <p dir="auto"><strong>What is the expected behavior?</strong><br> [(ngModel)] should be allowed in a form without an associated control.</p> <p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong><br> Allow mix of template and model driven form. This is specially useful in case part of the form in not really part of the actual business model.</p> <p dir="auto"><strong>Please tell us about your environment:</strong><br> RC2 with new forms</p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.0.0-rc.2</li> <li><strong>Browser:</strong> [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]</li> <li><strong>Language:</strong> [all | TypeScript X.X | ES6/7 | ES5 | Dart]</li> </ul>
<p dir="auto"><strong>feature request</strong></p> <p dir="auto"><strong>Current behavior</strong><br> If opted into the new forms and I have code like this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;form (submit)=&quot;process()&quot;&gt; &lt;input [(ngModel)]=&quot;propertyName&quot;&gt; &lt;/form&gt;"><pre class="notranslate"><code class="notranslate">&lt;form (submit)="process()"&gt; &lt;input [(ngModel)]="propertyName"&gt; &lt;/form&gt; </code></pre></div> <p dir="auto">And this throws an error: <code class="notranslate">ORIGINAL EXCEPTION: Name attribute must be set if ngModel is used within a form.</code></p> <p dir="auto"><strong>Expected/desired behavior</strong><br> I'd like to be able to use html forms and submit capabilities (such as submitting with the enter key) without having to specify a name (and use FormGroups and FormControls) for my ngModel bound inputs.</p> <ul dir="auto"> <li><strong>Angular version:</strong> 2.0.0-beta.RC2</li> </ul>
1
<p dir="auto">I had a question about a custom compound sharding algorithm. After editing the shard algorithm, the middleware prompt does not implement the interface, but the interface is implemented in the program.</p> <p dir="auto">Error message is as follows</p> <p dir="auto">Exception in thread "main" java.lang.AbstractMethodError: Receiver class com.mysql.sharding.proxy.complex.OrderTableComplex does not define or inherit an implementation of the resolved method 'abstract void init(java.util.Properties)' of interface org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor.<br> at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry.findRegisteredService(TypedSPIRegistry.java:66)<br> at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry.getRegisteredService(TypedSPIRegistry.java:113)<br> at org.apache.shardingsphere.infra.algorithm.ShardingSphereAlgorithmFactory.createAlgorithm(ShardingSphereAlgorithmFactory.java:41)<br> at org.apache.shardingsphere.sharding.rule.ShardingRule.lambda$new$0(ShardingRule.java:120)<br> at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)<br> at org.apache.shardingsphere.sharding.rule.ShardingRule.(ShardingRule.java:120)<br> at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:41)<br> at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:35)<br> at org.apache.shardingsphere.infra.rule.builder.database.DatabaseRulesBuilder.build(DatabaseRulesBuilder.java:64)<br> at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase.create(ShardingSphereDatabase.java:87)<br> at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.createGenericDatabases(ShardingSphereDatabasesFactory.java:79)<br> at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.create(ShardingSphereDatabasesFactory.java:67)<br> at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:90)<br> at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:56)<br> at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:73)<br> at org.apach</p> <p dir="auto">Can you provide information on the use of the composite sharding algorithm in version 5.3.1</p>
<p dir="auto">(shardingsphere-proxy5.3.1)I had a question about a custom compound sharding algorithm. After editing the shard algorithm, the middleware prompt does not implement the interface, but the interface is implemented in the program.</p> <p dir="auto">Error message is as follows</p> <p dir="auto">Exception in thread "main" java.lang.AbstractMethodError: Receiver class com.mysql.sharding.proxy.complex.OrderTableComplex does not define or inherit an implementation of the resolved method 'abstract void init(java.util.Properties)' of interface org.apache.shardingsphere.infra.util.spi.lifecycle.SPIPostProcessor.<br> at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry.findRegisteredService(TypedSPIRegistry.java:66)<br> at org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry.getRegisteredService(TypedSPIRegistry.java:113)<br> at org.apache.shardingsphere.infra.algorithm.ShardingSphereAlgorithmFactory.createAlgorithm(ShardingSphereAlgorithmFactory.java:41)<br> at org.apache.shardingsphere.sharding.rule.ShardingRule.lambda$new$0(ShardingRule.java:120)<br> at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)<br> at org.apache.shardingsphere.sharding.rule.ShardingRule.(ShardingRule.java:120)<br> at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:41)<br> at org.apache.shardingsphere.sharding.rule.builder.ShardingRuleBuilder.build(ShardingRuleBuilder.java:35)<br> at org.apache.shardingsphere.infra.rule.builder.database.DatabaseRulesBuilder.build(DatabaseRulesBuilder.java:64)<br> at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase.create(ShardingSphereDatabase.java:87)<br> at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.createGenericDatabases(ShardingSphereDatabasesFactory.java:79)<br> at org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabasesFactory.create(ShardingSphereDatabasesFactory.java:67)<br> at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:90)<br> at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:56)<br> at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:73)<br> at org.apach</p> <h1 dir="auto"></h1> <p dir="auto">Here is the code for the OrderTableComplex class:</p> <p dir="auto">package com.mysql.sharding.proxy.complex;</p> <p dir="auto">import com.mysql.sharding.proxy.util.ComplexStringUtils;<br> import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardingAlgorithm;<br> import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardingValue;<br> //import org.apache.shardingsphere.infra.<em>;<br> import java.util.</em>;</p> <p dir="auto">public class OrderTableComplex implements ComplexKeysShardingAlgorithm {</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private Properties props = new Properties(); @Override public Collection&lt;String&gt; doSharding(Collection&lt;String&gt; collection, ComplexKeysShardingValue&lt;Long&gt; complexKeysShardingValue) { List&lt;String&gt; shardingList = new ArrayList(); String logicTableName = complexKeysShardingValue.getLogicTableName(); Map&lt;String, Collection&lt;Long&gt;&gt; columnNameAndShardingValuesMap = complexKeysShardingValue.getColumnNameAndShardingValuesMap(); List IdList = (List) columnNameAndShardingValuesMap.get(&quot;id&quot;); List kList = (List) columnNameAndShardingValuesMap.get(&quot;k&quot;); List cList=(List)columnNameAndShardingValuesMap.get(&quot;c&quot;); List padList=(List)columnNameAndShardingValuesMap.get(&quot;pad&quot;); Long id = IdList != null ? ComplexStringUtils.getObjLong(IdList.get(0)) : 0L; Long k = kList != null ? ComplexStringUtils.getObjLong(kList.get(0)) : 0L; String c=cList != null ? ComplexStringUtils.getObjStr(cList.get(0)) : null; String pad=padList != null ? ComplexStringUtils.getObjStr(padList.get(0)) : null; Long modVal = 0L; Long MAX=(id+k+Integer.valueOf(String.valueOf(cList))+Integer.valueOf(String.valueOf(padList))); modVal=MAX%10; for (Iterator&lt;String&gt; iter = collection.iterator(); iter.hasNext(); ) { String str = iter.next(); if ((logicTableName + modVal).equals(str)) { shardingList.add(str); } } return shardingList; } @Override public void init() { } @Override public String getType() { return &quot;OrderTableComplex&quot;; } @Override public Properties getProps() { return this.props; } @Override public void setProps(Properties properties) { this.props = properties; }"><pre class="notranslate"><code class="notranslate">private Properties props = new Properties(); @Override public Collection&lt;String&gt; doSharding(Collection&lt;String&gt; collection, ComplexKeysShardingValue&lt;Long&gt; complexKeysShardingValue) { List&lt;String&gt; shardingList = new ArrayList(); String logicTableName = complexKeysShardingValue.getLogicTableName(); Map&lt;String, Collection&lt;Long&gt;&gt; columnNameAndShardingValuesMap = complexKeysShardingValue.getColumnNameAndShardingValuesMap(); List IdList = (List) columnNameAndShardingValuesMap.get("id"); List kList = (List) columnNameAndShardingValuesMap.get("k"); List cList=(List)columnNameAndShardingValuesMap.get("c"); List padList=(List)columnNameAndShardingValuesMap.get("pad"); Long id = IdList != null ? ComplexStringUtils.getObjLong(IdList.get(0)) : 0L; Long k = kList != null ? ComplexStringUtils.getObjLong(kList.get(0)) : 0L; String c=cList != null ? ComplexStringUtils.getObjStr(cList.get(0)) : null; String pad=padList != null ? ComplexStringUtils.getObjStr(padList.get(0)) : null; Long modVal = 0L; Long MAX=(id+k+Integer.valueOf(String.valueOf(cList))+Integer.valueOf(String.valueOf(padList))); modVal=MAX%10; for (Iterator&lt;String&gt; iter = collection.iterator(); iter.hasNext(); ) { String str = iter.next(); if ((logicTableName + modVal).equals(str)) { shardingList.add(str); } } return shardingList; } @Override public void init() { } @Override public String getType() { return "OrderTableComplex"; } @Override public Properties getProps() { return this.props; } @Override public void setProps(Properties properties) { this.props = properties; } </code></pre></div> <p dir="auto">}</p> <h1 dir="auto"></h1> <p dir="auto">Here is the pom configuration file for Maven</p> <p dir="auto"><br> 4.0.0</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;groupId&gt;com.mysql.sharding&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere1&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;source&gt;16&lt;/source&gt; &lt;target&gt;16&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core&lt;/artifactId&gt; &lt;version&gt;5.0.0-alpha&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;properties&gt; &lt;maven.compiler.source&gt;18&lt;/maven.compiler.source&gt; &lt;maven.compiler.target&gt;18&lt;/maven.compiler.target&gt; &lt;/properties&gt;"><pre class="notranslate"><code class="notranslate">&lt;groupId&gt;com.mysql.sharding&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere1&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;source&gt;16&lt;/source&gt; &lt;target&gt;16&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.shardingsphere&lt;/groupId&gt; &lt;artifactId&gt;shardingsphere-jdbc-core&lt;/artifactId&gt; &lt;version&gt;5.0.0-alpha&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;properties&gt; &lt;maven.compiler.source&gt;18&lt;/maven.compiler.source&gt; &lt;maven.compiler.target&gt;18&lt;/maven.compiler.target&gt; &lt;/properties&gt; </code></pre></div> # <p dir="auto">config-sharding.yaml</p> <p dir="auto">databaseName: sharding_db</p> <p dir="auto">dataSources:<br> ds_0:<br> url: jdbc:mysql://172.30.1.17:3306/ds_0?serverTimezone=UTC&amp;useSSL=false<br> username: root<br> password: root123<br> connectionTimeoutMilliseconds: 30000<br> idleTimeoutMilliseconds: 60000<br> maxLifetimeMilliseconds: 1800000<br> maxPoolSize: 50<br> minPoolSize: 1<br> ds_1:<br> url: jdbc:mysql://172.30.1.18:3306/ds_1?serverTimezone=UTC&amp;useSSL=false<br> username: root<br> password: root123<br> connectionTimeoutMilliseconds: 30000<br> idleTimeoutMilliseconds: 60000<br> maxLifetimeMilliseconds: 1800000<br> maxPoolSize: 50<br> minPoolSize: 1</p> <p dir="auto">rules:</p> <ul dir="auto"> <li> <p dir="auto">!SHARDING<br> tables:<br> sbtest1:<br> actualDataNodes: ds_${0..1}.sbtest1${0..9}</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="databaseStrategy: complex: shardingColumns: id,k,c,pad shardingAlgorithmName: order-db-complex tableStrategy: complex: shardingColumns: id,k,c,pad shardingAlgorithmName: order-table-complex keyGenerateStrategy: column: id keyGeneratorName: snowflake"><pre class="notranslate"><code class="notranslate">databaseStrategy: complex: shardingColumns: id,k,c,pad shardingAlgorithmName: order-db-complex tableStrategy: complex: shardingColumns: id,k,c,pad shardingAlgorithmName: order-table-complex keyGenerateStrategy: column: id keyGeneratorName: snowflake </code></pre></div> <p dir="auto">shardingAlgorithms:<br> order-table-complex:<br> type: OrderTableComplex<br> order-db-complex:<br> type: OrderDbComplex<br> alg_mod:<br> type: MOD<br> props:<br> sharding-count: 2<br> alg_hash_mod:<br> type: HASH_MOD<br> props:<br> sharding-count: 10</p> <p dir="auto">keyGenerators:<br> snowflake:<br> type: SNOWFLAKE</p> </li> </ul> <p dir="auto">Can you provide information on the use of the composite sharding algorithm in version 5.3.1</p>
1
<p dir="auto">I searched already several times but I cannot find out how to deactivate multiple cursors or how to change/deactivate the key binding. Finally, I open the issue here.</p> <p dir="auto">If there is an option for this, how could I possibly find it; or rather, how can I find and search available configuration options in my version of the editor?<br> The compiled coffeescript may make it hard to find options by using <code class="notranslate">grep</code>.</p>
<p dir="auto">On windows I expect that pressing Ctrl+Shift+Home or Ctrl+Shift+End selects all text from the current marker position to the start or beginning of the file.</p> <p dir="auto">This same behaviour exists in all windows native text editors from MS Word to notepad and Sublime Text.</p>
0
<p dir="auto">by <strong>rafal.jeczalik</strong>:</p> <pre class="notranslate">What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. <a href="http://play.golang.org/p/qgs2Q1ydez" rel="nofollow">http://play.golang.org/p/qgs2Q1ydez</a> What is the expected output? OK OK What do you see instead? invalid operation: b &amp;&amp; (i == 0 || i == 1) (mismatched types BoxedBool and bool) Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? OS X 10.9 Which version are you using? (run 'go version') go version devel +459f7bc40d85 Mon Feb 03 11:05:51 2014 -0800 darwin/amd64 Please provide any additional information below.</pre>
<pre class="notranslate">Multi-line function declarations of the form: func (this Something) name(args) retval { are not permitted. (Any one of the newlines shown above causes a syntax error.) For complex definitions, to prevent a line going over 80 characters, one must do something like: func (this Something) functionName(firstarg int, secondarg int) retval { // do stuff } which is ugly, but legal. There's no ambiguity in the first form - func must /always/ be followed by a body, eventually - it would be nice to support it. My setup: b69ec24ad6dc+ tip linux, amd64</pre>
0
<p dir="auto">This is about how to properly integrate twig sandbox with the twig-bundles configuration.</p> <p dir="auto">The major problem with this is, that there is very limited documentation available about the sandbox itself and none regarding the integration with symfony. I think the sandbox is a very nice feature and should get some more love (at least an article in the symfony docs).</p> <p dir="auto">When i was evaluating the sandbox extension and how to integrate it, there are a few questions that came up, that would be best answered by the "designers intent":</p> <ul dir="auto"> <li>Should there be a new twig env for each sandbox "profile"?<br> -&gt; If yes, how to duplicate the default twig environment with all its integrated features (profiler, loaders, forms etc) without too much pain?<br> -&gt; If no, how to enable different sandbox "profiles"? Could this be a feature request against twig itself?</li> <li>A way to setup the policy (or multiple policies) by configuration (similar to <a href="https://github.com/intaro/twig-sandbox-bundle">https://github.com/intaro/twig-sandbox-bundle</a> which is a good start, but isnt up to date and has its design flaws)</li> <li>If using the sandbox, the feature to be implemented is dealing with user supplied templates most of the time. There is a twig lint command and an article in the twig docs on how to validate the twig syntax. there are also some blog entries on how to create a validator for this. imho this should be included in the twig bundle just as the lint command is.</li> </ul>
<p dir="auto">It's only possible to have one route with a given name, but it is possible for duplicate route names to go undetected because Symfony will silently ignore the issue. I believe the second one found will overwrite the first, although I guess the loading order is non-deterministic (or determined by factors that can easily change).</p> <p dir="auto">Given two bundles both trying to define a login route:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" # src/AppBundle/Resources/config/routing.yml login: path: /login defaults: { _controller: AppBundle:Login:index }"><pre class="notranslate"><code class="notranslate"> # src/AppBundle/Resources/config/routing.yml login: path: /login defaults: { _controller: AppBundle:Login:index } </code></pre></div> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" # src/AdminBundle/Resources/config/routing.yml login: path: /admin/login defaults: { _controller: AdminBundle:Login:index }"><pre class="notranslate"><code class="notranslate"> # src/AdminBundle/Resources/config/routing.yml login: path: /admin/login defaults: { _controller: AdminBundle:Login:index } </code></pre></div> <p dir="auto">Only one of these routes will exist. This might be an extreme example, because usually the changed behaviour is noticeable. But for applications with many bundles or locale-specific routes, or where it's a simple content page instead of login, then it can be missed.</p> <p dir="auto">Usually Symfony is quite strict about configuration problems, helping to ensure they're spotted straight away. Is there a reason for the current behaviour, or can the router throw an exception when trying to overwrite a route?</p>
0
<p dir="auto">Seems that the width of a unicode character is not calculated correctly. See below.</p> <div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="α(1, 1)"><pre class="notranslate"><span class="pl-c1">α</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>)</pre></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/712232/9156587/8ffa887e-3ead-11e5-9432-6e0fe00e1f8d.png"><img src="https://cloud.githubusercontent.com/assets/712232/9156587/8ffa887e-3ead-11e5-9432-6e0fe00e1f8d.png" alt="indent" style="max-width: 100%;"></a></p>
<p dir="auto">it works fine if the package is in .julia/v0.x, but if it is somewhere else then it claims there is no <code class="notranslate">test/runtests.jl</code> even if my <code class="notranslate">LOAD_PATH</code> is set such that i can <code class="notranslate">using</code> it. i know that the recommended dev cycle is to keep packages in .julia, but would it make sense to make Pkg.test() work otherwise?</p>
0
<p dir="auto">The example</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf x = tf.Variable(1.) A = tf.Variable(tf.ones((3,3))) cost = tf.trace(tf.foldl(tf.matmul,tf.stack([x*A for _ in range(3)]))) tf.gradients(tf.gradients(cost, A), x) # TypeError: Second-order gradient for while loops not supported."><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-c1">1.</span>) <span class="pl-v">A</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-s1">tf</span>.<span class="pl-en">ones</span>((<span class="pl-c1">3</span>,<span class="pl-c1">3</span>))) <span class="pl-s1">cost</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">trace</span>(<span class="pl-s1">tf</span>.<span class="pl-en">foldl</span>(<span class="pl-s1">tf</span>.<span class="pl-s1">matmul</span>,<span class="pl-s1">tf</span>.<span class="pl-en">stack</span>([<span class="pl-s1">x</span><span class="pl-c1">*</span><span class="pl-v">A</span> <span class="pl-k">for</span> <span class="pl-s1">_</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">3</span>)]))) <span class="pl-s1">tf</span>.<span class="pl-en">gradients</span>(<span class="pl-s1">tf</span>.<span class="pl-en">gradients</span>(<span class="pl-s1">cost</span>, <span class="pl-v">A</span>), <span class="pl-s1">x</span>) <span class="pl-c"># TypeError: Second-order gradient for while loops not supported.</span></pre></div> <p dir="auto">illustrates that despite applying <code class="notranslate">tf.foldl</code> to a static list, the internal implementation via while loops leads to a type error. The problem disappears if the fold operation is carried out manually using a for loop. While implementing <code class="notranslate">foldl</code> using the while loop clearly makes the operation more widely applicable, it seems problematic if syntactic sugar can lead to code that has qualitative differences from a naive implementation using a static loop. I cannot help but wonder whether <code class="notranslate">foldl</code> could be more efficient in the static case as well, although that is more of a conjecture.</p> <p dir="auto">I think it would be nice if <code class="notranslate">foldl</code> (and other while loop derivatives) had a keyword that enabled or disabled the "dynamic mode" using while, or if, at the very least, the TypeError would occur at the <code class="notranslate">foldl</code>operation so that the error is easier to trace.</p> <h3 dir="auto">System information</h3> <ul dir="auto"> <li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:<br> Custom code.</li> <li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>:<br> Linux Ubuntu 16.04 LTS</li> <li><strong>TensorFlow installed from (source or binary)</strong>:<br> pip install.</li> <li><strong>TensorFlow version (use command below)</strong>:<br> v1.4.0-rc1-11-g130a514 1.4.0</li> <li><strong>Python version</strong>:<br> 3.5.4</li> <li><strong>Bazel version (if compiling from source)</strong>:<br> Not applicable.</li> <li><strong>GCC/Compiler version (if compiling from source)</strong>:<br> Not applicable.</li> <li><strong>CUDA/cuDNN version</strong>:<br> Did not use CUDA.</li> <li><strong>GPU model and memory</strong>:<br> Did not use GPU.</li> <li><strong>Exact command to reproduce</strong>:</li> </ul> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf x = tf.Variable(1.) A = tf.Variable(tf.ones((3,3))) cost = tf.trace(tf.foldl(tf.matmul,tf.stack([x*A for _ in range(3)]))) tf.gradients(tf.gradients(cost, A), x) # TypeError: Second-order gradient for while loops not supported."><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-c1">1.</span>) <span class="pl-v">A</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-s1">tf</span>.<span class="pl-en">ones</span>((<span class="pl-c1">3</span>,<span class="pl-c1">3</span>))) <span class="pl-s1">cost</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">trace</span>(<span class="pl-s1">tf</span>.<span class="pl-en">foldl</span>(<span class="pl-s1">tf</span>.<span class="pl-s1">matmul</span>,<span class="pl-s1">tf</span>.<span class="pl-en">stack</span>([<span class="pl-s1">x</span><span class="pl-c1">*</span><span class="pl-v">A</span> <span class="pl-k">for</span> <span class="pl-s1">_</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">3</span>)]))) <span class="pl-s1">tf</span>.<span class="pl-en">gradients</span>(<span class="pl-s1">tf</span>.<span class="pl-en">gradients</span>(<span class="pl-s1">cost</span>, <span class="pl-v">A</span>), <span class="pl-s1">x</span>) <span class="pl-c"># TypeError: Second-order gradient for while loops not supported.</span></pre></div>
<h3 dir="auto">System information</h3> <ul dir="auto"> <li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: No</li> <li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Windows 10</li> <li><strong>TensorFlow installed from (source or binary)</strong>: Binary</li> <li><strong>TensorFlow version (use command below)</strong>: unknown, command fails (this is the problem)</li> <li><strong>Bazel version (if compiling from source)</strong>: N/A</li> <li><strong>CUDA/cuDNN version</strong>: 8.0/5.1</li> <li><strong>GPU model and memory</strong>: GeForce GTX 970, 4 GB</li> <li><strong>Exact command to reproduce</strong>: import tensorflow as tf</li> </ul> <h3 dir="auto">Problem</h3> <p dir="auto">This is something I've seen in a <a href="https://github.com/tensorflow/tensorflow/issues/5949" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/5949/hovercard">previous issue report</a> added as a comment, but no one responded to it (except to say that you should be using cuDNN 5.1 instead of 6.0, which I am doing). I cannot even import tensorflow because it leads to the string of errors below. Someone in the linked issue suggested that this was caused by a missing MSVCP140.DLL, but this file is present in both my System32 and SysWOW64 folders (I have seen both mentioned). I have also installed the suggested Visual C++ Redistributable Update 3 with no luck.</p> <h3 dir="auto">Log</h3> <p dir="auto">Traceback (most recent call last):<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper<br> return importlib.import_module(mname)<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\importlib_<em>init</em>_.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> File "", line 986, in _gcd_import<br> File "", line 969, in _find_and_load<br> File "", line 958, in _find_and_load_unlocked<br> File "", line 666, in _load_unlocked<br> File "", line 577, in module_from_spec<br> File "", line 906, in create_module<br> File "", line 222, in _call_with_frames_removed<br> ImportError: DLL load failed: The specified module could not be found.</p> <p dir="auto">During handling of the above exception, another exception occurred:</p> <p dir="auto">Traceback (most recent call last):<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <br> from tensorflow.python.pywrap_tensorflow_internal import *<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <br> _pywrap_tensorflow_internal = swig_import_helper()<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper<br> return importlib.import_module('<em>pywrap_tensorflow_internal')<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\importlib_<em>init</em></em>.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> ImportError: No module named '_pywrap_tensorflow_internal'</p> <p dir="auto">During handling of the above exception, another exception occurred:</p> <p dir="auto">Traceback (most recent call last):<br> File "", line 1, in <br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_<em>init</em>_.py", line 24, in <br> from tensorflow.python import *<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python_<em>init</em>_.py", line 51, in <br> from tensorflow.python import pywrap_tensorflow<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in <br> raise ImportError(msg)<br> ImportError: Traceback (most recent call last):<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper<br> return importlib.import_module(mname)<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\importlib_<em>init</em>_.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> File "", line 986, in _gcd_import<br> File "", line 969, in _find_and_load<br> File "", line 958, in _find_and_load_unlocked<br> File "", line 666, in _load_unlocked<br> File "", line 577, in module_from_spec<br> File "", line 906, in create_module<br> File "", line 222, in _call_with_frames_removed<br> ImportError: DLL load failed: The specified module could not be found.</p> <p dir="auto">During handling of the above exception, another exception occurred:</p> <p dir="auto">Traceback (most recent call last):<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <br> from tensorflow.python.pywrap_tensorflow_internal import *<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <br> _pywrap_tensorflow_internal = swig_import_helper()<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper<br> return importlib.import_module('<em>pywrap_tensorflow_internal')<br> File "C:\Users\Elijah\AppData\Local\Programs\Python\Python35\lib\importlib_<em>init</em></em>.py", line 126, in import_module<br> return _bootstrap._gcd_import(name[level:], package, level)<br> ImportError: No module named '_pywrap_tensorflow_internal'</p>
0
<p dir="auto">Exception:<br> Traceback (most recent call last):<br> File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main<br> status = self.run(options, args)<br> File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run<br> prefix=options.prefix_path,<br> File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install<br> **kwargs<br> File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install<br> self.move_wheel_files(self.source_dir, root=root, prefix=prefix)<br> File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files<br> isolated=self.isolated,<br> File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 345, in move_wheel_files<br> clobber(source, lib_dir, True)<br> File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 316, in clobber<br> ensure_dir(destdir)<br> File "/usr/local/lib/python2.7/dist-packages/pip/utils/<strong>init</strong>.py", line 83, in ensure_dir<br> os.makedirs(path)<br> File "/usr/lib/python2.7/os.py", line 157, in makedirs<br> mkdir(name, mode)<br> OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/tensorflow_gpu-0.12.1.dist-info'</p>
<p dir="auto">Exception:<br> Traceback (most recent call last):<br> File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main<br> status = self.run(options, args)<br> File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run<br> prefix=options.prefix_path,<br> File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install<br> **kwargs<br> File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install<br> self.move_wheel_files(self.source_dir, root=root, prefix=prefix)<br> File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files<br> isolated=self.isolated,<br> File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 345, in move_wheel_files<br> clobber(source, lib_dir, True)<br> File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 316, in clobber<br> ensure_dir(destdir)<br> File "/usr/local/lib/python2.7/dist-packages/pip/utils/<strong>init</strong>.py", line 83, in ensure_dir<br> os.makedirs(path)<br> File "/usr/lib/python2.7/os.py", line 157, in makedirs<br> mkdir(name, mode)<br> OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/tensorflow_gpu-0.12.1.dist-info'<br> NOTE: Only file GitHub issues for bugs and feature requests. All other topics will be closed.</p> <p dir="auto">For general support from the community, see <a href="https://stackoverflow.com/questions/tagged/tensorflow" rel="nofollow">StackOverflow</a>.<br> To make bugs and feature requests more easy to find and organize, we close issues that are deemed<br> out of scope for GitHub Issues and point people to StackOverflow.</p> <p dir="auto">For bugs or installation issues, please provide the following information.<br> The more information you provide, the more easily we will be able to offer<br> help and advice.</p> <h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3> <h3 dir="auto">Environment info</h3> <p dir="auto">Operating System:</p> <p dir="auto">Installed version of CUDA and cuDNN:<br> (please attach the output of <code class="notranslate">ls -l /path/to/cuda/lib/libcud*</code>):</p> <p dir="auto">If installed from binary pip package, provide:</p> <ol dir="auto"> <li>A link to the pip package you installed:</li> <li>The output from <code class="notranslate">python -c "import tensorflow; print(tensorflow.__version__)"</code>.</li> </ol> <p dir="auto">If installed from source, provide</p> <ol dir="auto"> <li>The commit hash (<code class="notranslate">git rev-parse HEAD</code>)</li> <li>The output of <code class="notranslate">bazel version</code></li> </ol> <h3 dir="auto">If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)</h3> <h3 dir="auto">What other attempted solutions have you tried?</h3> <h3 dir="auto">Logs or other output that would be helpful</h3> <p dir="auto">(If logs are large, please upload as attachment or provide link).</p>
1
<h3 dir="auto">System information</h3> <ul dir="auto"> <li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:<br> Yes, script is below</li> <li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>:<br> Linux 4.15.0-23-generic <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="115938248" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/25" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/25/hovercard" href="https://github.com/tensorflow/tensorflow/issues/25">#25</a>-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux<br> VERSION="18.04 LTS (Bionic Beaver)"</li> <li><strong>TensorFlow installed from (source or binary)</strong>:<br> binary</li> <li><strong>TensorFlow version (use command below)</strong>:<br> v1.8.0-0-g93bc2e2072 1.8.0</li> <li><strong>Python version</strong>:<br> Python 3.6.5</li> <li><strong>Bazel version (if compiling from source)</strong>: n/a</li> <li><strong>GCC/Compiler version (if compiling from source)</strong>: n/a</li> <li><strong>CUDA/cuDNN version</strong>: n/a, using CPU version</li> <li><strong>GPU model and memory</strong>: n/a using CPU</li> <li><strong>Exact command to reproduce</strong>: just run "python3 script.py"</li> </ul> <h3 dir="auto">Describe the problem</h3> <p dir="auto">When using the tf.where function where a division by zero exists in one of the two where branches, you get a NaN gradient even if the division by zero was on the where branch which was not executed.</p> <p dir="auto">This seems similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="157280822" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/2540" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/2540/hovercard" href="https://github.com/tensorflow/tensorflow/issues/2540">#2540</a> but the workarounds suggested there (e.g. using tf.boolean_mask) did not work.</p> <h3 dir="auto">Source code / logs</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import tensorflow as tf sess = tf.Session() W1 = tf.Variable([2.0]) W2 = tf.Variable([0.0]) output=tf.where(W1&gt;4, W1/W2, tf.zeros_like(W1)) # gives correct answer (zero) since W1&gt;4 is false gradient=tf.gradients(output, W2)[0] # should be zero, but it gives NaN sess.run(tf.global_variables_initializer()) print(sess.run([output, gradient]))"><pre class="notranslate"><code class="notranslate">import tensorflow as tf sess = tf.Session() W1 = tf.Variable([2.0]) W2 = tf.Variable([0.0]) output=tf.where(W1&gt;4, W1/W2, tf.zeros_like(W1)) # gives correct answer (zero) since W1&gt;4 is false gradient=tf.gradients(output, W2)[0] # should be zero, but it gives NaN sess.run(tf.global_variables_initializer()) print(sess.run([output, gradient])) </code></pre></div> <h1 dir="auto">Program output:</h1> <p dir="auto">#[array([0.], dtype=float32), array([nan], dtype=float32)]</p>
<p dir="auto">Hello!</p> <p dir="auto">I've recently updated to tensorflow version 1.5.0, and suddenly receive an error, that I can't decipher, for code that worked before (in version 1.4.1): <code class="notranslate">Cannot use 'transducer_training/while/rnn/strided_slice' as input to 'gradients/transducer_training/while/rnn/while/Select_1_grad/Select/f_acc' because 'transducer_training/while/rnn/strided_slice' is in a while loop</code></p> <p dir="auto">I've also tried using the softmax_cross_entropy_with_logits function, but that still produced the same error. Here's the <a href="https://stackoverflow.com/questions/48713335/tensorflow-strided-slice-slicing-error-with-while-loop" rel="nofollow">stackoverflow</a> post, in case its a coding mistake on my part.<br> The model is a seq2seq variation.</p> <hr> <h3 dir="auto">System information</h3> <ul dir="auto"> <li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: Yes</li> <li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Ubuntu 16.04</li> <li><strong>TensorFlow installed from (source or binary)</strong>: Binary</li> <li><strong>TensorFlow version (use command below)</strong>: 1.5.0 (previous 1.4.1)</li> <li><strong>Python version</strong>: 2.7</li> <li><strong>Bazel version (if compiling from source)</strong>: N/A</li> <li><strong>GCC/Compiler version (if compiling from source)</strong>: N/A</li> <li><strong>CUDA/cuDNN version</strong>: N/A</li> <li><strong>GPU model and memory</strong>: N/A</li> <li><strong>Exact command to reproduce</strong>: Copy, paste and run the code</li> </ul> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf from tensorflow.contrib.rnn import LSTMCell, LSTMStateTuple from tensorflow.python.layers import core as layers_core # NOTE: Time major # ---------------- Constants Manager ---------------------------- class ConstantsManager(object): def __init__(self, input_dimensions, input_embedding_size, inputs_embedded, encoder_hidden_units, transducer_hidden_units, vocab_ids, input_block_size, beam_width): assert transducer_hidden_units == encoder_hidden_units, 'Encoder and transducer have to have the same amount' \ 'of hidden units' self.input_dimensions = input_dimensions self.vocab_ids = vocab_ids self.E_SYMBOL = len(self.vocab_ids) self.vocab_ids.append('E_SYMBOL') self.GO_SYMBOL = len(self.vocab_ids) self.vocab_ids.append('GO_SYMBOL') self.vocab_size = len(self.vocab_ids) self.input_embedding_size = input_embedding_size self.inputs_embedded = inputs_embedded self.encoder_hidden_units = encoder_hidden_units self.transducer_hidden_units = transducer_hidden_units self.input_block_size = input_block_size self.beam_width = beam_width self.batch_size = 1 # Cannot be increased, see paper self.log_prob_init_value = 0 # ----------------- Model --------------------------------------- class Model(object): def __init__(self, cons_manager): self.var_list = [] self.cons_manager = cons_manager self.max_blocks, self.inputs_full_raw, self.transducer_list_outputs, self.start_block, self.encoder_hidden_init,\ self.trans_hidden_init, self.logits, self.encoder_hidden_state_new, \ self.transducer_hidden_state_new, self.train_saver = self.build_full_transducer() self.targets, self.train_op, self.loss = self.build_training_step() def build_full_transducer(self): with tf.variable_scope('transducer_training'): embeddings = tf.Variable(tf.random_uniform([self.cons_manager.vocab_size, self.cons_manager.input_embedding_size], -1.0, 1.0), dtype=tf.float32, name='embedding') # Inputs max_blocks = tf.placeholder(dtype=tf.int32, name='max_blocks') # total amount of blocks to go through if self.cons_manager.inputs_embedded is True: input_type = tf.float32 else: input_type = tf.int32 inputs_full_raw = tf.placeholder(shape=(None, self.cons_manager.batch_size, self.cons_manager.input_dimensions), dtype=input_type, name='inputs_full_raw') # shape [max_time, 1, input_dims] transducer_list_outputs = tf.placeholder(shape=(None,), dtype=tf.int32, name='transducer_list_outputs') # amount to output per block start_block = tf.placeholder(dtype=tf.int32, name='transducer_start_block') # where to start the input encoder_hidden_init = tf.placeholder(shape=(2, 1, self.cons_manager.encoder_hidden_units), dtype=tf.float32, name='encoder_hidden_init') trans_hidden_init = tf.placeholder(shape=(2, 1, self.cons_manager.transducer_hidden_units), dtype=tf.float32, name='trans_hidden_init') # Temporary constants, maybe changed during inference end_symbol = tf.get_variable(name='end_symbol', initializer=tf.constant_initializer(self.cons_manager.vocab_size), shape=(), dtype=tf.int32) # Turn inputs into tensor which is easily readable# inputs_full = tf.reshape(inputs_full_raw, shape=[-1, self.cons_manager.input_block_size, self.cons_manager.batch_size, self.cons_manager.input_dimensions]) # Outputs outputs_ta = tf.TensorArray(dtype=tf.float32, size=max_blocks) init_state = (start_block, outputs_ta, encoder_hidden_init, trans_hidden_init) # Initiate cells, NOTE: if there is a future error, put these back inside the body function encoder_cell = tf.contrib.rnn.LSTMCell(num_units=self.cons_manager.encoder_hidden_units) transducer_cell = tf.contrib.rnn.LSTMCell(self.cons_manager.transducer_hidden_units) def cond(current_block, outputs_int, encoder_hidden, trans_hidden): return current_block &lt; start_block + max_blocks def body(current_block, outputs_int, encoder_hidden, trans_hidden): # --------------------- ENCODER ---------------------------------------------------------------------- encoder_inputs = inputs_full[current_block] encoder_inputs_length = [tf.shape(encoder_inputs)[0]] encoder_hidden_state = encoder_hidden if self.cons_manager.inputs_embedded is True: encoder_inputs_embedded = encoder_inputs else: encoder_inputs = tf.reshape(encoder_inputs, shape=[-1, self.cons_manager.batch_size]) encoder_inputs_embedded = tf.nn.embedding_lookup(embeddings, encoder_inputs) # Build model # Build previous state encoder_hidden_c, encoder_hidden_h = tf.split(encoder_hidden_state, num_or_size_splits=2, axis=0) encoder_hidden_c = tf.reshape(encoder_hidden_c, shape=[-1, self.cons_manager.encoder_hidden_units]) encoder_hidden_h = tf.reshape(encoder_hidden_h, shape=[-1, self.cons_manager.encoder_hidden_units]) encoder_hidden_state_t = LSTMStateTuple(encoder_hidden_c, encoder_hidden_h) # encoder_outputs: [max_time, batch_size, num_units] encoder_outputs, encoder_hidden_state_new = tf.nn.dynamic_rnn( encoder_cell, encoder_inputs_embedded, sequence_length=encoder_inputs_length, time_major=True, dtype=tf.float32, initial_state=encoder_hidden_state_t) # Modify output of encoder_hidden_state_new so that it can be fed back in again without problems. encoder_hidden_state_new = tf.concat([encoder_hidden_state_new.c, encoder_hidden_state_new.h], axis=0) encoder_hidden_state_new = tf.reshape(encoder_hidden_state_new, shape=[2, -1, self.cons_manager.encoder_hidden_units]) # --------------------- TRANSDUCER -------------------------------------------------------------------- encoder_raw_outputs = encoder_outputs # Save/load the state as one tensor, use encoder state as init if this is the first block trans_hidden_state = tf.cond(current_block &gt; 0, lambda: trans_hidden, lambda: encoder_hidden_state_new) transducer_amount_outputs = transducer_list_outputs[current_block - start_block] # Model building helper = tf.contrib.seq2seq.GreedyEmbeddingHelper( embedding=embeddings, start_tokens=tf.tile([self.cons_manager.GO_SYMBOL], [self.cons_manager.batch_size]), # TODO: check if this looks good end_token=end_symbol) # vocab size, so that it doesn't prematurely end the decoding attention_states = tf.transpose(encoder_raw_outputs, [1, 0, 2]) # attention_states: [batch_size, max_time, num_units] attention_mechanism = tf.contrib.seq2seq.LuongAttention( self.cons_manager.encoder_hidden_units, attention_states) decoder_cell = tf.contrib.seq2seq.AttentionWrapper( transducer_cell, attention_mechanism, attention_layer_size=self.cons_manager.transducer_hidden_units) projection_layer = layers_core.Dense(self.cons_manager.vocab_size, use_bias=False) # Build previous state trans_hidden_c, trans_hidden_h = tf.split(trans_hidden_state, num_or_size_splits=2, axis=0) trans_hidden_c = tf.reshape(trans_hidden_c, shape=[-1, self.cons_manager.transducer_hidden_units]) trans_hidden_h = tf.reshape(trans_hidden_h, shape=[-1, self.cons_manager.transducer_hidden_units]) trans_hidden_state_t = LSTMStateTuple(trans_hidden_c, trans_hidden_h) decoder = tf.contrib.seq2seq.BasicDecoder( decoder_cell, helper, decoder_cell.zero_state(1, tf.float32).clone(cell_state=trans_hidden_state_t), output_layer=projection_layer) outputs, transducer_hidden_state_new, _ = tf.contrib.seq2seq.dynamic_decode(decoder, output_time_major=True, maximum_iterations=transducer_amount_outputs) logits = outputs.rnn_output # logits of shape [max_time,batch_size,vocab_size] decoder_prediction = outputs.sample_id # For debugging # Modify output of transducer_hidden_state_new so that it can be fed back in again without problems. transducer_hidden_state_new = tf.concat( [transducer_hidden_state_new[0].c, transducer_hidden_state_new[0].h], axis=0) transducer_hidden_state_new = tf.reshape(transducer_hidden_state_new, shape=[2, -1, self.cons_manager.transducer_hidden_units]) # Note the outputs outputs_int = outputs_int.write(current_block - start_block, logits) return current_block + 1, outputs_int, encoder_hidden_state_new, transducer_hidden_state_new _, outputs_final, encoder_hidden_state_new, transducer_hidden_state_new = \ tf.while_loop(cond, body, init_state, parallel_iterations=1) # Process outputs outputs = outputs_final.concat() logits = tf.reshape( outputs, shape=(-1, 1, self.cons_manager.vocab_size)) # And now its [max_output_time, batch_size, vocab] # For loading the model later on logits = tf.identity(logits, name='logits') encoder_hidden_state_new = tf.identity(encoder_hidden_state_new, name='encoder_hidden_state_new') transducer_hidden_state_new = tf.identity(transducer_hidden_state_new, name='transducer_hidden_state_new') train_saver = tf.train.Saver() # For now save everything return max_blocks, inputs_full_raw, transducer_list_outputs, start_block, encoder_hidden_init,\ trans_hidden_init, logits, encoder_hidden_state_new, transducer_hidden_state_new, train_saver def build_training_step(self): targets = tf.placeholder(shape=(None,), dtype=tf.int32, name='targets') targets_one_hot = tf.one_hot(targets, depth=self.cons_manager.vocab_size, dtype=tf.float32) targets_one_hot = tf.Print(targets_one_hot, [targets], message='Targets: ', summarize=10) targets_one_hot = tf.Print(targets_one_hot, [tf.argmax(self.logits, axis=2)], message='Argmax: ', summarize=10) stepwise_cross_entropy = tf.nn.softmax_cross_entropy_with_logits(labels=targets_one_hot, logits=self.logits) loss = tf.reduce_mean(stepwise_cross_entropy) train_op = tf.train.AdamOptimizer().minimize(loss) return targets, train_op, loss constants_manager = ConstantsManager(input_dimensions=1, input_embedding_size=11, inputs_embedded=False, encoder_hidden_units=100, transducer_hidden_units=100, vocab_ids=[0, 1, 2], input_block_size=1, beam_width=5) model = Model(cons_manager=constants_manager)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span> <span class="pl-k">from</span> <span class="pl-s1">tensorflow</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">rnn</span> <span class="pl-k">import</span> <span class="pl-v">LSTMCell</span>, <span class="pl-v">LSTMStateTuple</span> <span class="pl-k">from</span> <span class="pl-s1">tensorflow</span>.<span class="pl-s1">python</span>.<span class="pl-s1">layers</span> <span class="pl-k">import</span> <span class="pl-s1">core</span> <span class="pl-k">as</span> <span class="pl-s1">layers_core</span> <span class="pl-c"># NOTE: Time major</span> <span class="pl-c"># ---------------- Constants Manager ----------------------------</span> <span class="pl-k">class</span> <span class="pl-v">ConstantsManager</span>(<span class="pl-s1">object</span>): <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">input_dimensions</span>, <span class="pl-s1">input_embedding_size</span>, <span class="pl-s1">inputs_embedded</span>, <span class="pl-s1">encoder_hidden_units</span>, <span class="pl-s1">transducer_hidden_units</span>, <span class="pl-s1">vocab_ids</span>, <span class="pl-s1">input_block_size</span>, <span class="pl-s1">beam_width</span>): <span class="pl-k">assert</span> <span class="pl-s1">transducer_hidden_units</span> <span class="pl-c1">==</span> <span class="pl-s1">encoder_hidden_units</span>, <span class="pl-s">'Encoder and transducer have to have the same amount'</span> \ <span class="pl-s">'of hidden units'</span> <span class="pl-s1">self</span>.<span class="pl-s1">input_dimensions</span> <span class="pl-c1">=</span> <span class="pl-s1">input_dimensions</span> <span class="pl-s1">self</span>.<span class="pl-s1">vocab_ids</span> <span class="pl-c1">=</span> <span class="pl-s1">vocab_ids</span> <span class="pl-s1">self</span>.<span class="pl-v">E_SYMBOL</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">vocab_ids</span>) <span class="pl-s1">self</span>.<span class="pl-s1">vocab_ids</span>.<span class="pl-en">append</span>(<span class="pl-s">'E_SYMBOL'</span>) <span class="pl-s1">self</span>.<span class="pl-v">GO_SYMBOL</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">vocab_ids</span>) <span class="pl-s1">self</span>.<span class="pl-s1">vocab_ids</span>.<span class="pl-en">append</span>(<span class="pl-s">'GO_SYMBOL'</span>) <span class="pl-s1">self</span>.<span class="pl-s1">vocab_size</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">vocab_ids</span>) <span class="pl-s1">self</span>.<span class="pl-s1">input_embedding_size</span> <span class="pl-c1">=</span> <span class="pl-s1">input_embedding_size</span> <span class="pl-s1">self</span>.<span class="pl-s1">inputs_embedded</span> <span class="pl-c1">=</span> <span class="pl-s1">inputs_embedded</span> <span class="pl-s1">self</span>.<span class="pl-s1">encoder_hidden_units</span> <span class="pl-c1">=</span> <span class="pl-s1">encoder_hidden_units</span> <span class="pl-s1">self</span>.<span class="pl-s1">transducer_hidden_units</span> <span class="pl-c1">=</span> <span class="pl-s1">transducer_hidden_units</span> <span class="pl-s1">self</span>.<span class="pl-s1">input_block_size</span> <span class="pl-c1">=</span> <span class="pl-s1">input_block_size</span> <span class="pl-s1">self</span>.<span class="pl-s1">beam_width</span> <span class="pl-c1">=</span> <span class="pl-s1">beam_width</span> <span class="pl-s1">self</span>.<span class="pl-s1">batch_size</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span> <span class="pl-c"># Cannot be increased, see paper</span> <span class="pl-s1">self</span>.<span class="pl-s1">log_prob_init_value</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span> <span class="pl-c"># ----------------- Model ---------------------------------------</span> <span class="pl-k">class</span> <span class="pl-v">Model</span>(<span class="pl-s1">object</span>): <span class="pl-k">def</span> <span class="pl-en">__init__</span>(<span class="pl-s1">self</span>, <span class="pl-s1">cons_manager</span>): <span class="pl-s1">self</span>.<span class="pl-s1">var_list</span> <span class="pl-c1">=</span> [] <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span> <span class="pl-c1">=</span> <span class="pl-s1">cons_manager</span> <span class="pl-s1">self</span>.<span class="pl-s1">max_blocks</span>, <span class="pl-s1">self</span>.<span class="pl-s1">inputs_full_raw</span>, <span class="pl-s1">self</span>.<span class="pl-s1">transducer_list_outputs</span>, <span class="pl-s1">self</span>.<span class="pl-s1">start_block</span>, <span class="pl-s1">self</span>.<span class="pl-s1">encoder_hidden_init</span>,\ <span class="pl-s1">self</span>.<span class="pl-s1">trans_hidden_init</span>, <span class="pl-s1">self</span>.<span class="pl-s1">logits</span>, <span class="pl-s1">self</span>.<span class="pl-s1">encoder_hidden_state_new</span>, \ <span class="pl-s1">self</span>.<span class="pl-s1">transducer_hidden_state_new</span>, <span class="pl-s1">self</span>.<span class="pl-s1">train_saver</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">build_full_transducer</span>() <span class="pl-s1">self</span>.<span class="pl-s1">targets</span>, <span class="pl-s1">self</span>.<span class="pl-s1">train_op</span>, <span class="pl-s1">self</span>.<span class="pl-s1">loss</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">build_training_step</span>() <span class="pl-k">def</span> <span class="pl-en">build_full_transducer</span>(<span class="pl-s1">self</span>): <span class="pl-k">with</span> <span class="pl-s1">tf</span>.<span class="pl-en">variable_scope</span>(<span class="pl-s">'transducer_training'</span>): <span class="pl-s1">embeddings</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-s1">tf</span>.<span class="pl-en">random_uniform</span>([<span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">vocab_size</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">input_embedding_size</span>], <span class="pl-c1">-</span><span class="pl-c1">1.0</span>, <span class="pl-c1">1.0</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'embedding'</span>) <span class="pl-c"># Inputs</span> <span class="pl-s1">max_blocks</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">int32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'max_blocks'</span>) <span class="pl-c"># total amount of blocks to go through</span> <span class="pl-k">if</span> <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">inputs_embedded</span> <span class="pl-c1">is</span> <span class="pl-c1">True</span>: <span class="pl-s1">input_type</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">float32</span> <span class="pl-k">else</span>: <span class="pl-s1">input_type</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">int32</span> <span class="pl-s1">inputs_full_raw</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">None</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">batch_size</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">input_dimensions</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">input_type</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'inputs_full_raw'</span>) <span class="pl-c"># shape [max_time, 1, input_dims]</span> <span class="pl-s1">transducer_list_outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">None</span>,), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">int32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'transducer_list_outputs'</span>) <span class="pl-c"># amount to output per block</span> <span class="pl-s1">start_block</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">int32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'transducer_start_block'</span>) <span class="pl-c"># where to start the input</span> <span class="pl-s1">encoder_hidden_init</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">encoder_hidden_units</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'encoder_hidden_init'</span>) <span class="pl-s1">trans_hidden_init</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">2</span>, <span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">transducer_hidden_units</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'trans_hidden_init'</span>) <span class="pl-c"># Temporary constants, maybe changed during inference</span> <span class="pl-s1">end_symbol</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">get_variable</span>(<span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'end_symbol'</span>, <span class="pl-s1">initializer</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-en">constant_initializer</span>(<span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">vocab_size</span>), <span class="pl-s1">shape</span><span class="pl-c1">=</span>(), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">int32</span>) <span class="pl-c"># Turn inputs into tensor which is easily readable#</span> <span class="pl-s1">inputs_full</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">inputs_full_raw</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">input_block_size</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">batch_size</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">input_dimensions</span>]) <span class="pl-c"># Outputs</span> <span class="pl-s1">outputs_ta</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">TensorArray</span>(<span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">size</span><span class="pl-c1">=</span><span class="pl-s1">max_blocks</span>) <span class="pl-s1">init_state</span> <span class="pl-c1">=</span> (<span class="pl-s1">start_block</span>, <span class="pl-s1">outputs_ta</span>, <span class="pl-s1">encoder_hidden_init</span>, <span class="pl-s1">trans_hidden_init</span>) <span class="pl-c"># Initiate cells, NOTE: if there is a future error, put these back inside the body function</span> <span class="pl-s1">encoder_cell</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">rnn</span>.<span class="pl-v">LSTMCell</span>(<span class="pl-s1">num_units</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">encoder_hidden_units</span>) <span class="pl-s1">transducer_cell</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">rnn</span>.<span class="pl-v">LSTMCell</span>(<span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">transducer_hidden_units</span>) <span class="pl-k">def</span> <span class="pl-en">cond</span>(<span class="pl-s1">current_block</span>, <span class="pl-s1">outputs_int</span>, <span class="pl-s1">encoder_hidden</span>, <span class="pl-s1">trans_hidden</span>): <span class="pl-k">return</span> <span class="pl-s1">current_block</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">start_block</span> <span class="pl-c1">+</span> <span class="pl-s1">max_blocks</span> <span class="pl-k">def</span> <span class="pl-en">body</span>(<span class="pl-s1">current_block</span>, <span class="pl-s1">outputs_int</span>, <span class="pl-s1">encoder_hidden</span>, <span class="pl-s1">trans_hidden</span>): <span class="pl-c"># --------------------- ENCODER ----------------------------------------------------------------------</span> <span class="pl-s1">encoder_inputs</span> <span class="pl-c1">=</span> <span class="pl-s1">inputs_full</span>[<span class="pl-s1">current_block</span>] <span class="pl-s1">encoder_inputs_length</span> <span class="pl-c1">=</span> [<span class="pl-s1">tf</span>.<span class="pl-en">shape</span>(<span class="pl-s1">encoder_inputs</span>)[<span class="pl-c1">0</span>]] <span class="pl-s1">encoder_hidden_state</span> <span class="pl-c1">=</span> <span class="pl-s1">encoder_hidden</span> <span class="pl-k">if</span> <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">inputs_embedded</span> <span class="pl-c1">is</span> <span class="pl-c1">True</span>: <span class="pl-s1">encoder_inputs_embedded</span> <span class="pl-c1">=</span> <span class="pl-s1">encoder_inputs</span> <span class="pl-k">else</span>: <span class="pl-s1">encoder_inputs</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">encoder_inputs</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">batch_size</span>]) <span class="pl-s1">encoder_inputs_embedded</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">embedding_lookup</span>(<span class="pl-s1">embeddings</span>, <span class="pl-s1">encoder_inputs</span>) <span class="pl-c"># Build model</span> <span class="pl-c"># Build previous state</span> <span class="pl-s1">encoder_hidden_c</span>, <span class="pl-s1">encoder_hidden_h</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">split</span>(<span class="pl-s1">encoder_hidden_state</span>, <span class="pl-s1">num_or_size_splits</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>) <span class="pl-s1">encoder_hidden_c</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">encoder_hidden_c</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">encoder_hidden_units</span>]) <span class="pl-s1">encoder_hidden_h</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">encoder_hidden_h</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">encoder_hidden_units</span>]) <span class="pl-s1">encoder_hidden_state_t</span> <span class="pl-c1">=</span> <span class="pl-v">LSTMStateTuple</span>(<span class="pl-s1">encoder_hidden_c</span>, <span class="pl-s1">encoder_hidden_h</span>) <span class="pl-c"># encoder_outputs: [max_time, batch_size, num_units]</span> <span class="pl-s1">encoder_outputs</span>, <span class="pl-s1">encoder_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">dynamic_rnn</span>( <span class="pl-s1">encoder_cell</span>, <span class="pl-s1">encoder_inputs_embedded</span>, <span class="pl-s1">sequence_length</span><span class="pl-c1">=</span><span class="pl-s1">encoder_inputs_length</span>, <span class="pl-s1">time_major</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">initial_state</span><span class="pl-c1">=</span><span class="pl-s1">encoder_hidden_state_t</span>) <span class="pl-c"># Modify output of encoder_hidden_state_new so that it can be fed back in again without problems.</span> <span class="pl-s1">encoder_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">concat</span>([<span class="pl-s1">encoder_hidden_state_new</span>.<span class="pl-s1">c</span>, <span class="pl-s1">encoder_hidden_state_new</span>.<span class="pl-s1">h</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>) <span class="pl-s1">encoder_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">encoder_hidden_state_new</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">2</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">encoder_hidden_units</span>]) <span class="pl-c"># --------------------- TRANSDUCER --------------------------------------------------------------------</span> <span class="pl-s1">encoder_raw_outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">encoder_outputs</span> <span class="pl-c"># Save/load the state as one tensor, use encoder state as init if this is the first block</span> <span class="pl-s1">trans_hidden_state</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">cond</span>(<span class="pl-s1">current_block</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>, <span class="pl-k">lambda</span>: <span class="pl-s1">trans_hidden</span>, <span class="pl-k">lambda</span>: <span class="pl-s1">encoder_hidden_state_new</span>) <span class="pl-s1">transducer_amount_outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">transducer_list_outputs</span>[<span class="pl-s1">current_block</span> <span class="pl-c1">-</span> <span class="pl-s1">start_block</span>] <span class="pl-c"># Model building</span> <span class="pl-s1">helper</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">seq2seq</span>.<span class="pl-v">GreedyEmbeddingHelper</span>( <span class="pl-s1">embedding</span><span class="pl-c1">=</span><span class="pl-s1">embeddings</span>, <span class="pl-s1">start_tokens</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-en">tile</span>([<span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-v">GO_SYMBOL</span>], [<span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">batch_size</span>]), <span class="pl-c"># TODO: check if this looks good</span> <span class="pl-s1">end_token</span><span class="pl-c1">=</span><span class="pl-s1">end_symbol</span>) <span class="pl-c"># vocab size, so that it doesn't prematurely end the decoding</span> <span class="pl-s1">attention_states</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">transpose</span>(<span class="pl-s1">encoder_raw_outputs</span>, [<span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">2</span>]) <span class="pl-c"># attention_states: [batch_size, max_time, num_units]</span> <span class="pl-s1">attention_mechanism</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">seq2seq</span>.<span class="pl-v">LuongAttention</span>( <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">encoder_hidden_units</span>, <span class="pl-s1">attention_states</span>) <span class="pl-s1">decoder_cell</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">seq2seq</span>.<span class="pl-v">AttentionWrapper</span>( <span class="pl-s1">transducer_cell</span>, <span class="pl-s1">attention_mechanism</span>, <span class="pl-s1">attention_layer_size</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">transducer_hidden_units</span>) <span class="pl-s1">projection_layer</span> <span class="pl-c1">=</span> <span class="pl-s1">layers_core</span>.<span class="pl-v">Dense</span>(<span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">vocab_size</span>, <span class="pl-s1">use_bias</span><span class="pl-c1">=</span><span class="pl-c1">False</span>) <span class="pl-c"># Build previous state</span> <span class="pl-s1">trans_hidden_c</span>, <span class="pl-s1">trans_hidden_h</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">split</span>(<span class="pl-s1">trans_hidden_state</span>, <span class="pl-s1">num_or_size_splits</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>) <span class="pl-s1">trans_hidden_c</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">trans_hidden_c</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">transducer_hidden_units</span>]) <span class="pl-s1">trans_hidden_h</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">trans_hidden_h</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">transducer_hidden_units</span>]) <span class="pl-s1">trans_hidden_state_t</span> <span class="pl-c1">=</span> <span class="pl-v">LSTMStateTuple</span>(<span class="pl-s1">trans_hidden_c</span>, <span class="pl-s1">trans_hidden_h</span>) <span class="pl-s1">decoder</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">seq2seq</span>.<span class="pl-v">BasicDecoder</span>( <span class="pl-s1">decoder_cell</span>, <span class="pl-s1">helper</span>, <span class="pl-s1">decoder_cell</span>.<span class="pl-en">zero_state</span>(<span class="pl-c1">1</span>, <span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>).<span class="pl-en">clone</span>(<span class="pl-s1">cell_state</span><span class="pl-c1">=</span><span class="pl-s1">trans_hidden_state_t</span>), <span class="pl-s1">output_layer</span><span class="pl-c1">=</span><span class="pl-s1">projection_layer</span>) <span class="pl-s1">outputs</span>, <span class="pl-s1">transducer_hidden_state_new</span>, <span class="pl-s1">_</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">contrib</span>.<span class="pl-s1">seq2seq</span>.<span class="pl-en">dynamic_decode</span>(<span class="pl-s1">decoder</span>, <span class="pl-s1">output_time_major</span><span class="pl-c1">=</span><span class="pl-c1">True</span>, <span class="pl-s1">maximum_iterations</span><span class="pl-c1">=</span><span class="pl-s1">transducer_amount_outputs</span>) <span class="pl-s1">logits</span> <span class="pl-c1">=</span> <span class="pl-s1">outputs</span>.<span class="pl-s1">rnn_output</span> <span class="pl-c"># logits of shape [max_time,batch_size,vocab_size]</span> <span class="pl-s1">decoder_prediction</span> <span class="pl-c1">=</span> <span class="pl-s1">outputs</span>.<span class="pl-s1">sample_id</span> <span class="pl-c"># For debugging</span> <span class="pl-c"># Modify output of transducer_hidden_state_new so that it can be fed back in again without problems.</span> <span class="pl-s1">transducer_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">concat</span>( [<span class="pl-s1">transducer_hidden_state_new</span>[<span class="pl-c1">0</span>].<span class="pl-s1">c</span>, <span class="pl-s1">transducer_hidden_state_new</span>[<span class="pl-c1">0</span>].<span class="pl-s1">h</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">0</span>) <span class="pl-s1">transducer_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>(<span class="pl-s1">transducer_hidden_state_new</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>[<span class="pl-c1">2</span>, <span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">transducer_hidden_units</span>]) <span class="pl-c"># Note the outputs</span> <span class="pl-s1">outputs_int</span> <span class="pl-c1">=</span> <span class="pl-s1">outputs_int</span>.<span class="pl-en">write</span>(<span class="pl-s1">current_block</span> <span class="pl-c1">-</span> <span class="pl-s1">start_block</span>, <span class="pl-s1">logits</span>) <span class="pl-k">return</span> <span class="pl-s1">current_block</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>, <span class="pl-s1">outputs_int</span>, <span class="pl-s1">encoder_hidden_state_new</span>, <span class="pl-s1">transducer_hidden_state_new</span> <span class="pl-s1">_</span>, <span class="pl-s1">outputs_final</span>, <span class="pl-s1">encoder_hidden_state_new</span>, <span class="pl-s1">transducer_hidden_state_new</span> <span class="pl-c1">=</span> \ <span class="pl-s1">tf</span>.<span class="pl-en">while_loop</span>(<span class="pl-s1">cond</span>, <span class="pl-s1">body</span>, <span class="pl-s1">init_state</span>, <span class="pl-s1">parallel_iterations</span><span class="pl-c1">=</span><span class="pl-c1">1</span>) <span class="pl-c"># Process outputs</span> <span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">outputs_final</span>.<span class="pl-en">concat</span>() <span class="pl-s1">logits</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reshape</span>( <span class="pl-s1">outputs</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">-</span><span class="pl-c1">1</span>, <span class="pl-c1">1</span>, <span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">vocab_size</span>)) <span class="pl-c"># And now its [max_output_time, batch_size, vocab]</span> <span class="pl-c"># For loading the model later on</span> <span class="pl-s1">logits</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">identity</span>(<span class="pl-s1">logits</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'logits'</span>) <span class="pl-s1">encoder_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">identity</span>(<span class="pl-s1">encoder_hidden_state_new</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'encoder_hidden_state_new'</span>) <span class="pl-s1">transducer_hidden_state_new</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">identity</span>(<span class="pl-s1">transducer_hidden_state_new</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'transducer_hidden_state_new'</span>) <span class="pl-s1">train_saver</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">train</span>.<span class="pl-v">Saver</span>() <span class="pl-c"># For now save everything</span> <span class="pl-k">return</span> <span class="pl-s1">max_blocks</span>, <span class="pl-s1">inputs_full_raw</span>, <span class="pl-s1">transducer_list_outputs</span>, <span class="pl-s1">start_block</span>, <span class="pl-s1">encoder_hidden_init</span>,\ <span class="pl-s1">trans_hidden_init</span>, <span class="pl-s1">logits</span>, <span class="pl-s1">encoder_hidden_state_new</span>, <span class="pl-s1">transducer_hidden_state_new</span>, <span class="pl-s1">train_saver</span> <span class="pl-k">def</span> <span class="pl-en">build_training_step</span>(<span class="pl-s1">self</span>): <span class="pl-s1">targets</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">None</span>,), <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">int32</span>, <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'targets'</span>) <span class="pl-s1">targets_one_hot</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">one_hot</span>(<span class="pl-s1">targets</span>, <span class="pl-s1">depth</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">cons_manager</span>.<span class="pl-s1">vocab_size</span>, <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>) <span class="pl-s1">targets_one_hot</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Print</span>(<span class="pl-s1">targets_one_hot</span>, [<span class="pl-s1">targets</span>], <span class="pl-s1">message</span><span class="pl-c1">=</span><span class="pl-s">'Targets: '</span>, <span class="pl-s1">summarize</span><span class="pl-c1">=</span><span class="pl-c1">10</span>) <span class="pl-s1">targets_one_hot</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Print</span>(<span class="pl-s1">targets_one_hot</span>, [<span class="pl-s1">tf</span>.<span class="pl-en">argmax</span>(<span class="pl-s1">self</span>.<span class="pl-s1">logits</span>, <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">2</span>)], <span class="pl-s1">message</span><span class="pl-c1">=</span><span class="pl-s">'Argmax: '</span>, <span class="pl-s1">summarize</span><span class="pl-c1">=</span><span class="pl-c1">10</span>) <span class="pl-s1">stepwise_cross_entropy</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">softmax_cross_entropy_with_logits</span>(<span class="pl-s1">labels</span><span class="pl-c1">=</span><span class="pl-s1">targets_one_hot</span>, <span class="pl-s1">logits</span><span class="pl-c1">=</span><span class="pl-s1">self</span>.<span class="pl-s1">logits</span>) <span class="pl-s1">loss</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reduce_mean</span>(<span class="pl-s1">stepwise_cross_entropy</span>) <span class="pl-s1">train_op</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">train</span>.<span class="pl-v">AdamOptimizer</span>().<span class="pl-en">minimize</span>(<span class="pl-s1">loss</span>) <span class="pl-k">return</span> <span class="pl-s1">targets</span>, <span class="pl-s1">train_op</span>, <span class="pl-s1">loss</span> <span class="pl-s1">constants_manager</span> <span class="pl-c1">=</span> <span class="pl-v">ConstantsManager</span>(<span class="pl-s1">input_dimensions</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">input_embedding_size</span><span class="pl-c1">=</span><span class="pl-c1">11</span>, <span class="pl-s1">inputs_embedded</span><span class="pl-c1">=</span><span class="pl-c1">False</span>, <span class="pl-s1">encoder_hidden_units</span><span class="pl-c1">=</span><span class="pl-c1">100</span>, <span class="pl-s1">transducer_hidden_units</span><span class="pl-c1">=</span><span class="pl-c1">100</span>, <span class="pl-s1">vocab_ids</span><span class="pl-c1">=</span>[<span class="pl-c1">0</span>, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>], <span class="pl-s1">input_block_size</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">beam_width</span><span class="pl-c1">=</span><span class="pl-c1">5</span>) <span class="pl-s1">model</span> <span class="pl-c1">=</span> <span class="pl-v">Model</span>(<span class="pl-s1">cons_manager</span><span class="pl-c1">=</span><span class="pl-s1">constants_manager</span>)</pre></div> <p dir="auto">I can try and make a smaller fail case if needed.</p> <p dir="auto">Thanks!<br> Nikita</p>
0
<p dir="auto">Hello! I've scoured through other issues and can't figure out why the warning is still around because it feels like I've done everything. Here's the setup:</p> <p dir="auto">Build scripts</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &quot;heroku-postbuild&quot;: &quot;npm run build:prod&quot;, &quot;build:webpack&quot;: &quot;webpack --progress --display-error-details --bail&quot;, &quot;build:dev&quot;: &quot;npm run build:webpack -- --config config/webpack/development.config.js&quot;, &quot;build:prod&quot;: &quot;NODE_ENV=production npm run build:webpack -- --config config/webpack/production.config.js&quot;,"><pre class="notranslate"><code class="notranslate"> "heroku-postbuild": "npm run build:prod", "build:webpack": "webpack --progress --display-error-details --bail", "build:dev": "npm run build:webpack -- --config config/webpack/development.config.js", "build:prod": "NODE_ENV=production npm run build:webpack -- --config config/webpack/production.config.js", </code></pre></div> <p dir="auto"><code class="notranslate">base.config.js</code>:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="config.plugins = [ new webpack.optimize.OccurenceOrderPlugin(), new webpack.DefinePlugin({ //sets up some other constants on process.env }), ];"><pre class="notranslate"><code class="notranslate">config.plugins = [ new webpack.optimize.OccurenceOrderPlugin(), new webpack.DefinePlugin({ //sets up some other constants on process.env }), ]; </code></pre></div> <p dir="auto"><code class="notranslate">production.config.js</code>:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var config = extend({}, baseConfig); config.plugins.push( new webpack.DefinePlugin({ &quot;process.env.NODE_ENV&quot;: JSON.stringify(&quot;production&quot;), }), new webpack.optimize.UglifyJsPlugin({ mangle: true, compress: { warnings: false }, output: { comments: false }, exclude: [/\.min\.js$/gi] }), new webpack.optimize.DedupePlugin(), //some more plugins"><pre class="notranslate"><code class="notranslate">var config = extend({}, baseConfig); config.plugins.push( new webpack.DefinePlugin({ "process.env.NODE_ENV": JSON.stringify("production"), }), new webpack.optimize.UglifyJsPlugin({ mangle: true, compress: { warnings: false }, output: { comments: false }, exclude: [/\.min\.js$/gi] }), new webpack.optimize.DedupePlugin(), //some more plugins </code></pre></div> <p dir="auto">Using React v15.4.2 and Webpack v1.14.0. I'm not sure what I'm missing -- DefinePlugin and UglifyJsPlugin seem to be declared properly, and the <code class="notranslate">NODE_ENV</code> is set to production up in the script. Any help would be greatly appreciated! Thank you!</p>
<p dir="auto">I ran into a strange problem when transitioning to React <code class="notranslate">0.14.0</code>.</p> <p dir="auto">I use a promisified API internally in my application, and for various reasons I need a handle to the mounted instance of an element. No big deal, this is how I get a handle to that instance after react has finished its non-deterministic render:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// some renderer service return new Promise(function (resolve, reject) { React.render(reactElement, node, function () { resolve(this) }) }) // someone using the renderer service return renderer(element, someNode) .then(function (mountedElement) { ... })"><pre class="notranslate"><code class="notranslate">// some renderer service return new Promise(function (resolve, reject) { React.render(reactElement, node, function () { resolve(this) }) }) // someone using the renderer service return renderer(element, someNode) .then(function (mountedElement) { ... }) </code></pre></div> <p dir="auto">When I update to <code class="notranslate">0.14.0</code>, I should be able to just swap out implementations without a thought, right?</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="return new Promise(function (resolve, reject) { ReactDOM.render(reactElement, node, function () { resolve(this) }) })"><pre class="notranslate"><code class="notranslate">return new Promise(function (resolve, reject) { ReactDOM.render(reactElement, node, function () { resolve(this) }) }) </code></pre></div> <p dir="auto">Well, apparently not :(.</p> <p dir="auto">I'm getting an error message correlating to <a href="https://gist.github.com/jimfb/4faa6cbfb1ef476bd105">this help wiki</a>...</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner)."><pre class="notranslate"><code class="notranslate">Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner). </code></pre></div> <p dir="auto">I have scraped through the app looking for some "invalid usage of refs", but there aren't any. I also can't see a case where I have more than one React on the page (unless there's some shenanigans caused by including <code class="notranslate">react-dom/server</code> in a browser, but I have removed it and checked against that case too: same problem)?</p> <p dir="auto">Loading React (browserify):</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" let React = require('react') let ReactDOM = require('react-dom') let Server = require('react-dom/server')"><pre class="notranslate"><code class="notranslate"> let React = require('react') let ReactDOM = require('react-dom') let Server = require('react-dom/server') </code></pre></div> <p dir="auto">package.json</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" &quot;dependencies&quot;: { &quot;react&quot;: &quot;0.14.0&quot;, &quot;react-dom&quot;: &quot;0.14.0&quot; }"><pre class="notranslate"><code class="notranslate"> "dependencies": { "react": "0.14.0", "react-dom": "0.14.0" } </code></pre></div> <p dir="auto"><code class="notranslate">npm ls | grep react</code></p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="│ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] ├─┬ [email protected] ├─┬ [email protected] │ └─┬ [email protected]"><pre class="notranslate"><code class="notranslate">│ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] ├─┬ [email protected] ├─┬ [email protected] │ └─┬ [email protected] </code></pre></div>
0
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nikomatsakis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nikomatsakis">@nikomatsakis</a> and I agreed that it would be better to change the <code class="notranslate">ty::substs</code> type to have the <code class="notranslate">tps</code> field be a map from node IDs to types, rather than a vector of types as it is now. This allows ty params to be referred to based on their node IDs rather than positionally as they are now. Among other things, this addresses a bug in the code that I'm trying to isolate in which class ty params get concatenated with method ty params and sometimes a param gets duplicated. Niko said he would do this as a byproduct of rewriting the code for self types.</p>
<p dir="auto">As per comment in the former function in resolve.</p>
0
<p dir="auto">In my org, each team is creating ES index daily so the number of index grows very quickly. Usually users are interested only in their 'team' data. Currently, some users execute query using Kibana w/o specifying index and field name(it takes _all'). Such queries at times, bring our cluster to halt/ crash etc. I would like queries to be restricted such that only well defined queries can be executed on ES. A well defined query is a query which specifies index and field name. I could not find a server level config param to enforce such constraint on user queries. I posted question on ES forum but did not get a clear answer.</p> <p dir="auto">This bug/ ER filed to have ES server level parameter such as to enforce user defined queries to have index name and/ or field name specified.</p>
<p dir="auto">Hitting <code class="notranslate">/_search</code> causes elasticsearch to search all types, all indices.<br> With very large indices this is a problem.<br> We currently have ~30Tb of data across multiple logstash indices.</p> <p dir="auto">If someone talks to ES (eg, using sense or a other method) and doesn't specify the index name, the cluster effectively grinds to a half until we restart it.</p> <p dir="auto">Can we have an option to require specifying at least one index name to the search endpoint?</p> <p dir="auto">Thanks!</p>
1
<p dir="auto"><strong>Migrated issue, originally created by vijchti</strong></p> <p dir="auto">Oracle database via cx_Oracle on SQLAlchemy 1.0.6 (also tested on some older versions, got same result).</p> <p dir="auto">About 50% of the time, using Query.first() on a query will return None. The rest of the time the query returns results as expected. The same behavior is not seen when using the expression language by itself or when using any other client on this or any other computer to retrieve the data. This issue can be duplicated on other machines.</p> <p dir="auto">Here is the code I used to generate this error:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sqlalchemy import create_engine, Column, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker # Fix environment variables import os try: del os.environ['ORACLE_HOME'] except KeyError: pass os.environ['TNS_ADMIN'] = r'C:\product\11.1.0\client_1\network\admin' os.environ['PATH'] = r'C:\product\11.1.0\client_1\BIN;' + os.environ['PATH'] engine = create_engine(r'oracle+cx_oracle://{username}:{password}@{service_name}'.format(username='USER', password='PASSWORD', service_name='SERVICE')) session_maker = sessionmaker(bind=engine) base_class = declarative_base() class Lot(base_class): __tablename__ = 'lot' __table_args__ = {'schema': 'SCHEMA_NAME'} lot_key = Column(Integer, primary_key=True) lot_id = Column(String) session = session_maker() cursor = session.query(Lot) result = cursor.first() if result is None: raise Exception"><pre class="notranslate"><code class="notranslate">from sqlalchemy import create_engine, Column, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker # Fix environment variables import os try: del os.environ['ORACLE_HOME'] except KeyError: pass os.environ['TNS_ADMIN'] = r'C:\product\11.1.0\client_1\network\admin' os.environ['PATH'] = r'C:\product\11.1.0\client_1\BIN;' + os.environ['PATH'] engine = create_engine(r'oracle+cx_oracle://{username}:{password}@{service_name}'.format(username='USER', password='PASSWORD', service_name='SERVICE')) session_maker = sessionmaker(bind=engine) base_class = declarative_base() class Lot(base_class): __tablename__ = 'lot' __table_args__ = {'schema': 'SCHEMA_NAME'} lot_key = Column(Integer, primary_key=True) lot_id = Column(String) session = session_maker() cursor = session.query(Lot) result = cursor.first() if result is None: raise Exception </code></pre></div>
<h3 dir="auto">Describe the bug</h3> <p dir="auto">I am not able to specify language configuration when using PostgreSQL full-text search functions (<code class="notranslate">to_tsvector</code>, <code class="notranslate">websearch_to_tsvector</code>, <code class="notranslate">plainto_tsvector</code>) with psycopg3. The cause appears to be sqlalchemy casting the configuration string to <code class="notranslate">VARCHAR</code>.</p> <p dir="auto">The example is adapted from the tutorial and works as intended with psycopg2 (so does omitting language configuration in psycopg3).</p> <h3 dir="auto">To Reproduce</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import sqlalchemy as sa url = &quot;postgresql+psycopg://postgres:pgpass@localhost:5432/mydb?sslmode=require&quot; engine = sa.create_engine(url, echo=True) metadata = sa.MetaData() t = sa.Table( &quot;BakedGoods&quot;, metadata, sa.Column(&quot;name&quot;, sa.Text), ) t.create(engine, checkfirst=True) with engine.begin() as con: con.execute(t.insert().values( [{&quot;name&quot;: &quot;Apple pie&quot;}, {&quot;name&quot;: &quot;Banana bread&quot;}])) goods = con.execute( sa.select(t.c.name).where( sa.func.to_tsvector('english', t.c.name)\ .match('apples', postgresql_regconfig='english') ) ) for row in goods.all(): print(f&quot;Found some apples in {row[0]}&quot;) t.drop(engine, checkfirst=True)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">as</span> <span class="pl-s1">sa</span> <span class="pl-s1">url</span> <span class="pl-c1">=</span> <span class="pl-s">"postgresql+psycopg://postgres:pgpass@localhost:5432/mydb?sslmode=require"</span> <span class="pl-s1">engine</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-en">create_engine</span>(<span class="pl-s1">url</span>, <span class="pl-s1">echo</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">metadata</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-v">MetaData</span>() <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-v">Table</span>( <span class="pl-s">"BakedGoods"</span>, <span class="pl-s1">metadata</span>, <span class="pl-s1">sa</span>.<span class="pl-v">Column</span>(<span class="pl-s">"name"</span>, <span class="pl-s1">sa</span>.<span class="pl-v">Text</span>), ) <span class="pl-s1">t</span>.<span class="pl-en">create</span>(<span class="pl-s1">engine</span>, <span class="pl-s1">checkfirst</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-k">with</span> <span class="pl-s1">engine</span>.<span class="pl-en">begin</span>() <span class="pl-k">as</span> <span class="pl-s1">con</span>: <span class="pl-s1">con</span>.<span class="pl-en">execute</span>(<span class="pl-s1">t</span>.<span class="pl-en">insert</span>().<span class="pl-en">values</span>( [{<span class="pl-s">"name"</span>: <span class="pl-s">"Apple pie"</span>}, {<span class="pl-s">"name"</span>: <span class="pl-s">"Banana bread"</span>}])) <span class="pl-s1">goods</span> <span class="pl-c1">=</span> <span class="pl-s1">con</span>.<span class="pl-en">execute</span>( <span class="pl-s1">sa</span>.<span class="pl-en">select</span>(<span class="pl-s1">t</span>.<span class="pl-s1">c</span>.<span class="pl-s1">name</span>).<span class="pl-en">where</span>( <span class="pl-s1">sa</span>.<span class="pl-s1">func</span>.<span class="pl-en">to_tsvector</span>(<span class="pl-s">'english'</span>, <span class="pl-s1">t</span>.<span class="pl-s1">c</span>.<span class="pl-s1">name</span>)\ .<span class="pl-en">match</span>(<span class="pl-s">'apples'</span>, <span class="pl-s1">postgresql_regconfig</span><span class="pl-c1">=</span><span class="pl-s">'english'</span>) ) ) <span class="pl-k">for</span> <span class="pl-s1">row</span> <span class="pl-c1">in</span> <span class="pl-s1">goods</span>.<span class="pl-en">all</span>(): <span class="pl-en">print</span>(<span class="pl-s">f"Found some apples in <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">row</span>[<span class="pl-c1">0</span>]<span class="pl-kos">}</span></span>"</span>) <span class="pl-s1">t</span>.<span class="pl-en">drop</span>(<span class="pl-s1">engine</span>, <span class="pl-s1">checkfirst</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</pre></div> <h3 dir="auto">Error</h3> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="❯ /home/kozak/.virtualenvs/psycopg-test/bin/python /home/kozak/Projects/tests/sqlalchemy_psycopg/test.py 2022-12-13 09:40:40,061 INFO sqlalchemy.engine.Engine select pg_catalog.version() 2022-12-13 09:40:40,061 INFO sqlalchemy.engine.Engine [raw sql] {} 2022-12-13 09:40:40,063 INFO sqlalchemy.engine.Engine select current_schema() 2022-12-13 09:40:40,063 INFO sqlalchemy.engine.Engine [raw sql] {} 2022-12-13 09:40:40,064 INFO sqlalchemy.engine.Engine show standard_conforming_strings 2022-12-13 09:40:40,064 INFO sqlalchemy.engine.Engine [raw sql] {} 2022-12-13 09:40:40,068 INFO sqlalchemy.engine.Engine BEGIN (implicit) 2022-12-13 09:40:40,072 INFO sqlalchemy.engine.Engine SELECT pg_catalog.pg_class.relname FROM pg_catalog.pg_class JOIN pg_catalog.pg_namespace ON pg_catalog.pg_namespace.oid = pg_catalog.pg_class.relnamespace WHERE pg_catalog.pg_class.relname = %(table_name)s::VARCHAR(64) COLLATE &quot;C&quot; AND pg_catalog.pg_class.relkind = ANY (ARRAY[%(param_1)s::VARCHAR, %(param_2)s::VARCHAR, %(param_3)s::VARCHAR, %(param_4)s::VARCHAR, %(param_5)s::VARCHAR]) AND pg_catalog.pg_table_is_visible(pg_catalog.pg_class.oid) AND pg_catalog.pg_namespace.nspname != %(nspname_1)s::VARCHAR(64) COLLATE &quot;C&quot; 2022-12-13 09:40:40,072 INFO sqlalchemy.engine.Engine [generated in 0.00024s] {'table_name': 'BakedGoods', 'param_1': 'r', 'param_2': 'p', 'param_3': 'f', 'param_4': 'v', 'param_5': 'm', 'nspname_1': 'pg_catalog'} 2022-12-13 09:40:40,074 INFO sqlalchemy.engine.Engine COMMIT 2022-12-13 09:40:40,075 INFO sqlalchemy.engine.Engine BEGIN (implicit) 2022-12-13 09:40:40,076 INFO sqlalchemy.engine.Engine INSERT INTO &quot;BakedGoods&quot; (name) VALUES (%(name_m0)s::VARCHAR), (%(name_m1)s::VARCHAR) 2022-12-13 09:40:40,076 INFO sqlalchemy.engine.Engine [no key 0.00012s] {'name_m0': 'Apple pie', 'name_m1': 'Banana bread'} 2022-12-13 09:40:40,078 INFO sqlalchemy.engine.Engine SELECT &quot;BakedGoods&quot;.name FROM &quot;BakedGoods&quot; WHERE to_tsvector(%(to_tsvector_1)s::VARCHAR, &quot;BakedGoods&quot;.name) @@ plainto_tsquery('english', %(to_tsvector_2)s::VARCHAR) 2022-12-13 09:40:40,078 INFO sqlalchemy.engine.Engine [generated in 0.00025s] {'to_tsvector_1': 'english', 'to_tsvector_2': 'apples'} 2022-12-13 09:40:40,079 INFO sqlalchemy.engine.Engine ROLLBACK Traceback (most recent call last): File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 1964, in _exec_single_context self.dialect.do_execute( File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/default.py&quot;, line 746, in do_execute cursor.execute(statement, parameters) File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/psycopg/cursor.py&quot;, line 725, in execute raise ex.with_traceback(None) psycopg.errors.UndefinedFunction: function to_tsvector(character varying, text) does not exist LINE 3: WHERE to_tsvector($1::VARCHAR, &quot;BakedGoods&quot;.name) @@ plainto... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. The above exception was the direct cause of the following exception: Traceback (most recent call last): File &quot;/home/kozak/Projects/tests/sqlalchemy_psycopg/test.py&quot;, line 20, in &lt;module&gt; goods = con.execute( ^^^^^^^^^^^^ File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 1414, in execute return meth( ^^^^^ File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/sql/elements.py&quot;, line 489, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 1638, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 1842, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 1983, in _exec_single_context self._handle_dbapi_exception( File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 2325, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py&quot;, line 1964, in _exec_single_context self.dialect.do_execute( File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/default.py&quot;, line 746, in do_execute cursor.execute(statement, parameters) File &quot;/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/psycopg/cursor.py&quot;, line 725, in execute raise ex.with_traceback(None) sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedFunction) function to_tsvector(character varying, text) does not exist LINE 3: WHERE to_tsvector($1::VARCHAR, &quot;BakedGoods&quot;.name) @@ plainto... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. [SQL: SELECT &quot;BakedGoods&quot;.name FROM &quot;BakedGoods&quot; WHERE to_tsvector(%(to_tsvector_1)s::VARCHAR, &quot;BakedGoods&quot;.name) @@ plainto_tsquery('english', %(to_tsvector_2)s::VARCHAR)] [parameters: {'to_tsvector_1': 'english', 'to_tsvector_2': 'apples'}] (Background on this error at: https://sqlalche.me/e/20/f405)"><pre class="notranslate"><code class="notranslate">❯ /home/kozak/.virtualenvs/psycopg-test/bin/python /home/kozak/Projects/tests/sqlalchemy_psycopg/test.py 2022-12-13 09:40:40,061 INFO sqlalchemy.engine.Engine select pg_catalog.version() 2022-12-13 09:40:40,061 INFO sqlalchemy.engine.Engine [raw sql] {} 2022-12-13 09:40:40,063 INFO sqlalchemy.engine.Engine select current_schema() 2022-12-13 09:40:40,063 INFO sqlalchemy.engine.Engine [raw sql] {} 2022-12-13 09:40:40,064 INFO sqlalchemy.engine.Engine show standard_conforming_strings 2022-12-13 09:40:40,064 INFO sqlalchemy.engine.Engine [raw sql] {} 2022-12-13 09:40:40,068 INFO sqlalchemy.engine.Engine BEGIN (implicit) 2022-12-13 09:40:40,072 INFO sqlalchemy.engine.Engine SELECT pg_catalog.pg_class.relname FROM pg_catalog.pg_class JOIN pg_catalog.pg_namespace ON pg_catalog.pg_namespace.oid = pg_catalog.pg_class.relnamespace WHERE pg_catalog.pg_class.relname = %(table_name)s::VARCHAR(64) COLLATE "C" AND pg_catalog.pg_class.relkind = ANY (ARRAY[%(param_1)s::VARCHAR, %(param_2)s::VARCHAR, %(param_3)s::VARCHAR, %(param_4)s::VARCHAR, %(param_5)s::VARCHAR]) AND pg_catalog.pg_table_is_visible(pg_catalog.pg_class.oid) AND pg_catalog.pg_namespace.nspname != %(nspname_1)s::VARCHAR(64) COLLATE "C" 2022-12-13 09:40:40,072 INFO sqlalchemy.engine.Engine [generated in 0.00024s] {'table_name': 'BakedGoods', 'param_1': 'r', 'param_2': 'p', 'param_3': 'f', 'param_4': 'v', 'param_5': 'm', 'nspname_1': 'pg_catalog'} 2022-12-13 09:40:40,074 INFO sqlalchemy.engine.Engine COMMIT 2022-12-13 09:40:40,075 INFO sqlalchemy.engine.Engine BEGIN (implicit) 2022-12-13 09:40:40,076 INFO sqlalchemy.engine.Engine INSERT INTO "BakedGoods" (name) VALUES (%(name_m0)s::VARCHAR), (%(name_m1)s::VARCHAR) 2022-12-13 09:40:40,076 INFO sqlalchemy.engine.Engine [no key 0.00012s] {'name_m0': 'Apple pie', 'name_m1': 'Banana bread'} 2022-12-13 09:40:40,078 INFO sqlalchemy.engine.Engine SELECT "BakedGoods".name FROM "BakedGoods" WHERE to_tsvector(%(to_tsvector_1)s::VARCHAR, "BakedGoods".name) @@ plainto_tsquery('english', %(to_tsvector_2)s::VARCHAR) 2022-12-13 09:40:40,078 INFO sqlalchemy.engine.Engine [generated in 0.00025s] {'to_tsvector_1': 'english', 'to_tsvector_2': 'apples'} 2022-12-13 09:40:40,079 INFO sqlalchemy.engine.Engine ROLLBACK Traceback (most recent call last): File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context self.dialect.do_execute( File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 746, in do_execute cursor.execute(statement, parameters) File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/psycopg/cursor.py", line 725, in execute raise ex.with_traceback(None) psycopg.errors.UndefinedFunction: function to_tsvector(character varying, text) does not exist LINE 3: WHERE to_tsvector($1::VARCHAR, "BakedGoods".name) @@ plainto... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/kozak/Projects/tests/sqlalchemy_psycopg/test.py", line 20, in &lt;module&gt; goods = con.execute( ^^^^^^^^^^^^ File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1414, in execute return meth( ^^^^^ File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 489, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1842, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1983, in _exec_single_context self._handle_dbapi_exception( File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2325, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context self.dialect.do_execute( File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 746, in do_execute cursor.execute(statement, parameters) File "/home/kozak/.virtualenvs/psycopg-test/lib/python3.11/site-packages/psycopg/cursor.py", line 725, in execute raise ex.with_traceback(None) sqlalchemy.exc.ProgrammingError: (psycopg.errors.UndefinedFunction) function to_tsvector(character varying, text) does not exist LINE 3: WHERE to_tsvector($1::VARCHAR, "BakedGoods".name) @@ plainto... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. [SQL: SELECT "BakedGoods".name FROM "BakedGoods" WHERE to_tsvector(%(to_tsvector_1)s::VARCHAR, "BakedGoods".name) @@ plainto_tsquery('english', %(to_tsvector_2)s::VARCHAR)] [parameters: {'to_tsvector_1': 'english', 'to_tsvector_2': 'apples'}] (Background on this error at: https://sqlalche.me/e/20/f405) </code></pre></div> <h3 dir="auto">Versions</h3> <ul dir="auto"> <li>OS: Ubuntu 22.04</li> <li>Python: 3.11</li> <li>SQLAlchemy: 2.0.0b4</li> <li>Database: PostgreSQL 14</li> <li>DBAPI (eg: psycopg, cx_oracle, mysqlclient): psycopg-3.1.4 (works with psycopg2)</li> </ul> <h3 dir="auto">Additional context</h3> <p dir="auto">Similar issues:</p> <ul dir="auto"> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="956609390" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/6833" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/6833/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/6833">#6833</a> is about <code class="notranslate">asyncpg</code> support</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="958527841" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/6842" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/6842/hovercard?comment_id=908563170&amp;comment_type=issue_comment" href="https://github.com/sqlalchemy/sqlalchemy/issues/6842#issuecomment-908563170">#6842 (comment)</a> discusses the problem but it sounds like the conclusion is that the issue would not come up, and it does.</li> </ul> <p dir="auto">If you consider this a duplicate, apologies &amp; feel free to close. I thought it was warranted to report seeing as psycopg3 support was just introduced in the 2.0 beta.</p>
0
<p dir="auto">I am creating this so I can pin it &amp; to help keep track of several related issues/work-items.</p> <h2 dir="auto">Things we know:</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The grab handles are bright white/accent color/dark black</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The grab handles are too narrow / the borders are too thick / why can't I use the area outside the window frame to resize?</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="448313525" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/994" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/994/hovercard" href="https://github.com/microsoft/terminal/issues/994">#994</a> Split panes need an indicator to show which is focused</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="448313626" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1000" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1000/hovercard" href="https://github.com/microsoft/terminal/issues/1000">#1000</a> Literally anything having to do with panes</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Click/Right click icon should display Minimize/Maximize/Close menu</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> When you click <code class="notranslate">Cascade Windows</code> , <code class="notranslate">Show windows stacked</code> etc is completely ignored by Terminal</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="411337080" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/376" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/376/hovercard" href="https://github.com/microsoft/terminal/issues/376">#376</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="441494703" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/545" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/545/hovercard" href="https://github.com/microsoft/terminal/issues/545">#545</a> Commandline applications can't receive mouse input</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="583581637" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/4980" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/4980/hovercard" href="https://github.com/microsoft/terminal/issues/4980">#4980</a> system theme light = light borders, even if terminal theme dark</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The title bar isn't acrylic, but now since architectural changes <em>could</em> be!</li> </ul> <h2 dir="auto">Things related to tabs:</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="460696043" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1625" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1625/hovercard" href="https://github.com/microsoft/terminal/issues/1625">#1625</a> Has another giant bucket of work that's more specific to the non-client area (where the tabs are)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The area above the tabs isn't draggable</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Can't pop/drag out tabs</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Can't reorder tabs</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="441897905" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/597" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/597/hovercard" href="https://github.com/microsoft/terminal/issues/597">#597</a> Without using tabs don't shrink/expand like browser tabs / I want to set a min width for my tabs / I want a fixed width for my tabs / I want tabs to expand to split the available space / any other possible tab sizing]</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="511534511" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/3300" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/3300/hovercard" href="https://github.com/microsoft/terminal/issues/3300">#3300</a> Tab bar doesn't grow when you resize the window, it only shrinks (Regressed in v0.6)</li> </ul> <h2 dir="auto">Things that people want, but we <em>won't</em> be able to fix:</h2> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="462704565" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1753" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1753/hovercard" href="https://github.com/microsoft/terminal/issues/1753">#1753</a> Can only set "Opacity" of acrylic, not "Blur" / Can't have a non-acrylic transparency</li> </ul> <h2 dir="auto">Things fixed in v0.6:</h2> <details> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="484239365" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/2513" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/2513/hovercard" href="https://github.com/microsoft/terminal/issues/2513">#2513</a> Double click to non-client area should maximize the Window.</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="443973517" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/771" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/771/hovercard" href="https://github.com/microsoft/terminal/issues/771">#771</a> The default 'active' tab contrast is very low (especially light mode)</li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The tabs don't look as good as you'd like <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="442973306" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/702" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/702/hovercard" href="https://github.com/microsoft/terminal/issues/702">#702</a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2971735/59956008-ce108700-948d-11e9-8fbf-93d332ec8d3d.png"><img src="https://user-images.githubusercontent.com/2971735/59956008-ce108700-948d-11e9-8fbf-93d332ec8d3d.png" alt="grafik" style="max-width: 100%;"></a></li> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="445082791" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/857" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/857/hovercard" href="https://github.com/microsoft/terminal/issues/857">#857</a> When the window is smaller than the sum of the width of the tabs, the tabs are cut off, without indication to scroll</li> </ul> </details> <h2 dir="auto">Things fixed in v0.5:</h2> <details> <ul class="contains-task-list"> <li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="460290537" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1589" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1589/hovercard" href="https://github.com/microsoft/terminal/issues/1589">#1589</a> Alt+F4 doesn't close the Window (PR#2526)</li> </ul> </details> <h2 dir="auto">Things fixed in v0.3:</h2> <details> <ul class="contains-task-list"> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The non-client area looks wrong; PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="446852006" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/929" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/929/hovercard" href="https://github.com/microsoft/terminal/pull/929">#929</a>, Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="445240004" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/872" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/872/hovercard" href="https://github.com/microsoft/terminal/issues/872">#872</a><br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2971735/59955981-a28d9c80-948d-11e9-8e93-b8727acf4b23.png"><img src="https://user-images.githubusercontent.com/2971735/59955981-a28d9c80-948d-11e9-8e93-b8727acf4b23.png" alt="grafik" style="max-width: 100%;"></a> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2971735/59956367-1d57b700-9490-11e9-820f-9ab49ec4b9f0.png"><img src="https://user-images.githubusercontent.com/2971735/59956367-1d57b700-9490-11e9-820f-9ab49ec4b9f0.png" alt="grafik" style="max-width: 100%;"></a></p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> The plus button is too big, too small, too wide, too narrow (fixed in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="467153501" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1934" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/1934/hovercard" href="https://github.com/microsoft/terminal/pull/1934">#1934</a>)<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2971735/59956019-e54f7480-948d-11e9-83f3-ffb73146ff91.png"><img src="https://user-images.githubusercontent.com/2971735/59956019-e54f7480-948d-11e9-83f3-ffb73146ff91.png" alt="grafik" style="max-width: 100%;"></a></p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="441573358" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/564" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/564/hovercard" href="https://github.com/microsoft/terminal/issues/564">#564</a> draggable area in title bar (PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="467596764" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1948" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/1948/hovercard" href="https://github.com/microsoft/terminal/pull/1948">#1948</a>)</p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> When maximized on displays with a different DPI, the edges of the window are cut off. (Fixed by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="466677853" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1921" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/1921/hovercard" href="https://github.com/microsoft/terminal/pull/1921">#1921</a>)</p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="442043191" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/608" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/608/hovercard" href="https://github.com/microsoft/terminal/issues/608">#608</a> <em>the text of my tabs is too long</em></p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I'm using the dark theme but am still seeing a white border and header are still white. (Might be fixed by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="446852006" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/929" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/929/hovercard" href="https://github.com/microsoft/terminal/pull/929">#929</a>)<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/20868530/60559084-43871d80-9d00-11e9-94f1-a4c42a7b4da3.png"><img src="https://user-images.githubusercontent.com/20868530/60559084-43871d80-9d00-11e9-94f1-a4c42a7b4da3.png" alt="image" style="max-width: 100%;"></a></p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> (caused by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="446852006" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/929" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/terminal/pull/929/hovercard" href="https://github.com/microsoft/terminal/pull/929">#929</a>, tracked in <del><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="460696043" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1625" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1625/hovercard" href="https://github.com/microsoft/terminal/issues/1625">#1625</a></del> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="467824188" data-permission-text="Title is private" data-url="https://github.com/microsoft/terminal/issues/1963" data-hovercard-type="issue" data-hovercard-url="/microsoft/terminal/issues/1963/hovercard" href="https://github.com/microsoft/terminal/issues/1963">#1963</a>) The titlebar does not have my accent color in it<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5177512/60739019-87a33980-9f1d-11e9-951a-400f6d3095ec.png"><img src="https://user-images.githubusercontent.com/5177512/60739019-87a33980-9f1d-11e9-951a-400f6d3095ec.png" alt="image" style="max-width: 100%;"></a></p> </li> <li class="task-list-item"> <p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Resizing the window causes the UI to disapper/reappear.<br> <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1243172/59960788-78f06780-94c5-11e9-863d-3adfa6f1c6d2.gif"><img src="https://user-images.githubusercontent.com/1243172/59960788-78f06780-94c5-11e9-863d-3adfa6f1c6d2.gif" alt="ezgif-2-9dc95bf607e7" data-animated-image="" style="max-width: 100%;"></a></p> </li> </ul> </details>
<h1 dir="auto">Environment</h1> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0 Windows Terminal version (if applicable): 0.4.2382.0 Far Manager: version 3.0.0.5454 x64 "><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0 Windows Terminal version (if applicable): 0.4.2382.0 Far Manager: version 3.0.0.5454 x64 </code></pre></div> <h1 dir="auto">Steps to reproduce</h1> <ol dir="auto"> <li><a href="https://www.farmanager.com/download.php?l=en" rel="nofollow">Install</a> Far Manager</li> <li>Open it from Windows Terminal by executing <code class="notranslate">far</code> command</li> <li>Position cursor on any directory</li> <li>Press <code class="notranslate">Shift + Enter</code></li> </ol> <h1 dir="auto">Expected behavior</h1> <p dir="auto">Far Manager opens File Explorer in the selected directory</p> <h1 dir="auto">Actual behavior</h1> <p dir="auto">Far Manager just opens folder in the Windows Terminal as if you would press without <code class="notranslate">Shift</code> key.<br> In Powershell, CMD, Cmder Far Manager works as expected.</p>
0
<p dir="auto">The legacy 0.10 docs mentions having only 1 root element as a restriction to <code class="notranslate">replace</code>.<br> Current version (0.11) seems to have <code class="notranslate">replace: true</code> work for components with multiple root elements, but v-with breaks with no warning.</p> <p dir="auto"><a href="http://jsfiddle.net/r4h8p5jz/" rel="nofollow">doesn't work - http://jsfiddle.net/r4h8p5jz/</a><br> <a href="http://jsfiddle.net/r4h8p5jz/1/" rel="nofollow">works - http://jsfiddle.net/r4h8p5jz/1/</a></p> <div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var ComponentA = Vue.extend({ //template: '&lt;div&gt;{{bar}}&lt;/div&gt;', // this works template: '&lt;div&gt;{{bar}}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;', // this doesn't replace: true }); new Vue({ el: 'body', template: '&lt;component-a v-with=&quot;bar: foo&quot;&gt;&lt;/component-a&gt;', data: { foo: 'Test Test Test Test' }, components: { 'component-a': ComponentA } });"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-v">ComponentA</span> <span class="pl-c1">=</span> <span class="pl-v">Vue</span><span class="pl-kos">.</span><span class="pl-en">extend</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c">//template: '&lt;div&gt;{{bar}}&lt;/div&gt;', // this works</span> <span class="pl-c1">template</span>: <span class="pl-s">'&lt;div&gt;{{bar}}&lt;/div&gt;&lt;div&gt;&lt;/div&gt;'</span><span class="pl-kos">,</span> <span class="pl-c">// this doesn't</span> <span class="pl-c1">replace</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">new</span> <span class="pl-v">Vue</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">el</span>: <span class="pl-s">'body'</span><span class="pl-kos">,</span> <span class="pl-c1">template</span>: <span class="pl-s">'&lt;component-a v-with="bar: foo"&gt;&lt;/component-a&gt;'</span><span class="pl-kos">,</span> <span class="pl-c1">data</span>: <span class="pl-kos">{</span> <span class="pl-c1">foo</span>: <span class="pl-s">'Test Test Test Test'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">components</span>: <span class="pl-kos">{</span> <span class="pl-s">'component-a'</span>: <span class="pl-v">ComponentA</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">See this: <a href="http://jsfiddle.net/qm2wqg8u/5/" rel="nofollow">http://jsfiddle.net/qm2wqg8u/5/</a></p> <p dir="auto">If replace set to true, and a multi root template could cause the param can't pass into component. In this case, the comment block cause the problem.</p>
1
<p dir="auto">TL;DR archive/zip cannot decompress a password protected with AES 256 encryption, deflated archive.</p> <p dir="auto">Answers to the 5 questions:</p> <ul dir="auto"> <li>go version go1.5 darwin/amd64</li> <li>OSX Yosemite Version 10.10.5 (14F27) / 2.4 GHz Intel Core 2 Duo</li> <li>Attempted to unzip password protected .zip file: <ul dir="auto"> <li>Password Encryption was set to AES256</li> <li>Zip Compression Method was set to COMP_DEFLATE</li> <li>Zip Compression Level was set to DEFLATE_LEVEL_NORMAL</li> </ul> </li> <li>Expected that the zip file would be extracted fully – as successfully tested using other tools including <a href="http://unarchiver.c3.cx/commandline" rel="nofollow">unar</a> and <a href="http://online.b1.org/online" rel="nofollow">http://online.b1.org/online</a></li> <li>err returned ErrAlgorithm – "zip: unsupported compression algorithm"</li> </ul> <p dir="auto">I should begin by mentioning that, if the Java code is modified to comment out the following lines; that archive/zip can handle these files without issue:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// parameters.setEncryptFiles(true); // parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES); // parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256); // parameters.setPassword(&quot;verySecurePassword&quot;);"><pre class="notranslate"><code class="notranslate">// parameters.setEncryptFiles(true); // parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES); // parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256); // parameters.setPassword("verySecurePassword"); </code></pre></div> <p dir="auto">The jar file for <code class="notranslate">net.lingala.zip4j</code> is at <a href="http://www.lingala.net/zip4j/download.php" rel="nofollow">www.lingala.net/zip4j/download.php</a>; The following commands compiled and ran the java code below in terminal:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$&gt; javac -cp zip4j_1.3.2.jar ZipTest.java $&gt; java -cp .:./zip4j_1.3.2.jar ZipTest"><pre class="notranslate"><code class="notranslate">$&gt; javac -cp zip4j_1.3.2.jar ZipTest.java $&gt; java -cp .:./zip4j_1.3.2.jar ZipTest </code></pre></div> <p dir="auto">Below is the Java code used to generate the zip file.</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import java.io.File; import net.lingala.zip4j.core.ZipFile; import net.lingala.zip4j.model.ZipParameters; import net.lingala.zip4j.util.Zip4jConstants; public class ZipTest { public static void main(String[] args) { System.out.println(&quot;starting...&quot;); try { ZipFile zipFile = new ZipFile(&quot;/Users/alex/Desktop/test_nopass.zip&quot;); ZipParameters parameters = new ZipParameters(); parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL); parameters.setEncryptFiles(true); parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES); parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256); parameters.setPassword(&quot;verySecurePassword&quot;); zipFile.addFile(new File(&quot;/Users/alex/Desktop/test.txt&quot;), parameters); } catch (Exception e) { System.out.println(e.getMessage()); } System.out.println(&quot;done&quot;); } }"><pre class="notranslate"><code class="notranslate">import java.io.File; import net.lingala.zip4j.core.ZipFile; import net.lingala.zip4j.model.ZipParameters; import net.lingala.zip4j.util.Zip4jConstants; public class ZipTest { public static void main(String[] args) { System.out.println("starting..."); try { ZipFile zipFile = new ZipFile("/Users/alex/Desktop/test_nopass.zip"); ZipParameters parameters = new ZipParameters(); parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE); parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL); parameters.setEncryptFiles(true); parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_AES); parameters.setAesKeyStrength(Zip4jConstants.AES_STRENGTH_256); parameters.setPassword("verySecurePassword"); zipFile.addFile(new File("/Users/alex/Desktop/test.txt"), parameters); } catch (Exception e) { System.out.println(e.getMessage()); } System.out.println("done"); } } </code></pre></div> <p dir="auto">and below is the main.go code for attempting to decompress the zip archive</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="package main import ( &quot;archive/zip&quot; &quot;fmt&quot; &quot;log&quot; &quot;os&quot; &quot;path&quot; ) func main() { // Open a zip archive for reading. r, err := zip.OpenReader(&quot;/Users/alex/Desktop/test.zip&quot;) if err != nil { log.Fatal(err) } defer r.Close() // Iterate through the files in the archive, // printing some of their contents. for _, fi := range r.File { fmt.Printf(&quot;Contents of %s:\n&quot;, fi.Name) fmt.Printf(&quot;Size compressed: %d bytes\n&quot;, fi.CompressedSize64) fmt.Printf(&quot;Size uncompressed:%d bytes\n&quot;, fi.UncompressedSize64) fmt.Printf(&quot;Creator Version: %d\n&quot;, fi.CreatorVersion) fmt.Printf(&quot;Reader Version: %d\n&quot;, fi.ReaderVersion) fmt.Printf(&quot;Flags: %d\n&quot;, fi.Flags) fmt.Printf(&quot;Method: %d\n&quot;, fi.Method) fmt.Printf(&quot;Extra: %s\n&quot;, fi.Extra) f, err := os.Create(path.Join(&quot;/Users/alex/Desktop&quot;, fi.Name)) if err != nil { f.Close() fmt.Println(err) } rc, err := fi.DataOffset() if err != nil { fmt.Println(err) } else { fmt.Printf(&quot;%d&quot;, rc) } f.Close() } fmt.Println(&quot;DONE!&quot;) }"><pre class="notranslate"><code class="notranslate">package main import ( "archive/zip" "fmt" "log" "os" "path" ) func main() { // Open a zip archive for reading. r, err := zip.OpenReader("/Users/alex/Desktop/test.zip") if err != nil { log.Fatal(err) } defer r.Close() // Iterate through the files in the archive, // printing some of their contents. for _, fi := range r.File { fmt.Printf("Contents of %s:\n", fi.Name) fmt.Printf("Size compressed: %d bytes\n", fi.CompressedSize64) fmt.Printf("Size uncompressed:%d bytes\n", fi.UncompressedSize64) fmt.Printf("Creator Version: %d\n", fi.CreatorVersion) fmt.Printf("Reader Version: %d\n", fi.ReaderVersion) fmt.Printf("Flags: %d\n", fi.Flags) fmt.Printf("Method: %d\n", fi.Method) fmt.Printf("Extra: %s\n", fi.Extra) f, err := os.Create(path.Join("/Users/alex/Desktop", fi.Name)) if err != nil { f.Close() fmt.Println(err) } rc, err := fi.DataOffset() if err != nil { fmt.Println(err) } else { fmt.Printf("%d", rc) } f.Close() } fmt.Println("DONE!") } </code></pre></div>
<p dir="auto">ZIP file format specification includes encrypted archives.<br> Current implementation doesn't support writing/reading such archives.</p>
1
<p dir="auto"><strong>Is your feature request related to a problem? Please describe.</strong></p> <p dir="auto">My company is currently happily using SQLAlchemy (thank you!), and mostly happily using <a href="https://github.com/dropbox/sqlalchemy-stubs">https://github.com/dropbox/sqlalchemy-stubs</a>. However, the latter is unmaintained and thus we're regularly hitting issues (and submitting fixes) that don't get fixed or land. Thus, I'd love to switch to the first-party mypy support.</p> <p dir="auto">I've tried doing the switch, but found, among other issues, that annotating every foreign key column and relationship property was frustrating.</p> <p dir="auto">For instance, previously:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sqlalchemy import Column, Integer, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import as_declarative @as_declarative() class Base: pass class Foo(Base): id = Column(Integer(), primary_key=True) bars = relationship(&quot;Bar&quot;, uselist=True) class Bar(base): id = Column(Integer(), primary_key=True) foo_id = Column(ForeignKey(Foo.id)) foo = relationship(&quot;Foo&quot;)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Column</span>, <span class="pl-v">Integer</span>, <span class="pl-v">ForeignKey</span> <span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span>.<span class="pl-s1">orm</span> <span class="pl-k">import</span> <span class="pl-s1">relationship</span> <span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span>.<span class="pl-s1">ext</span>.<span class="pl-s1">declarative</span> <span class="pl-k">import</span> <span class="pl-s1">as_declarative</span> <span class="pl-en">@<span class="pl-en">as_declarative</span>()</span> <span class="pl-k">class</span> <span class="pl-v">Base</span>: <span class="pl-k">pass</span> <span class="pl-k">class</span> <span class="pl-v">Foo</span>(<span class="pl-v">Base</span>): <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Integer</span>(), <span class="pl-s1">primary_key</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">bars</span> <span class="pl-c1">=</span> <span class="pl-en">relationship</span>(<span class="pl-s">"Bar"</span>, <span class="pl-s1">uselist</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-k">class</span> <span class="pl-v">Bar</span>(<span class="pl-s1">base</span>): <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Integer</span>(), <span class="pl-s1">primary_key</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">foo_id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">ForeignKey</span>(<span class="pl-v">Foo</span>.<span class="pl-s1">id</span>)) <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-en">relationship</span>(<span class="pl-s">"Foo"</span>)</pre></div> <p dir="auto">With sqlalchemy2-stubs:</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sqlalchemy import Column, Integer, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import as_declarative from typing import List, Optional @as_declarative() class Base: pass class Foo(Base): id = Column(Integer(), primary_key=True) bars: &quot;Bar&quot; = relationship(&quot;Bar&quot;, back_populates=&quot;foo&quot;, uselist=True) class Bar(base): id = Column(Integer(), primary_key=True) foo_id: Optional[int] = Column(ForeignKey(Foo.id)) foo: Optional[Foo] = relationship(&quot;Foo&quot;, back_populates=&quot;bars&quot;)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Column</span>, <span class="pl-v">Integer</span>, <span class="pl-v">ForeignKey</span> <span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span>.<span class="pl-s1">orm</span> <span class="pl-k">import</span> <span class="pl-s1">relationship</span> <span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span>.<span class="pl-s1">ext</span>.<span class="pl-s1">declarative</span> <span class="pl-k">import</span> <span class="pl-s1">as_declarative</span> <span class="pl-k">from</span> <span class="pl-s1">typing</span> <span class="pl-k">import</span> <span class="pl-v">List</span>, <span class="pl-v">Optional</span> <span class="pl-en">@<span class="pl-en">as_declarative</span>()</span> <span class="pl-k">class</span> <span class="pl-v">Base</span>: <span class="pl-k">pass</span> <span class="pl-k">class</span> <span class="pl-v">Foo</span>(<span class="pl-v">Base</span>): <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Integer</span>(), <span class="pl-s1">primary_key</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">bars</span>: <span class="pl-s">"Bar"</span> <span class="pl-c1">=</span> <span class="pl-en">relationship</span>(<span class="pl-s">"Bar"</span>, <span class="pl-s1">back_populates</span><span class="pl-c1">=</span><span class="pl-s">"foo"</span>, <span class="pl-s1">uselist</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-k">class</span> <span class="pl-v">Bar</span>(<span class="pl-s1">base</span>): <span class="pl-s1">id</span> <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">Integer</span>(), <span class="pl-s1">primary_key</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">foo_id</span>: <span class="pl-v">Optional</span>[<span class="pl-s1">int</span>] <span class="pl-c1">=</span> <span class="pl-v">Column</span>(<span class="pl-v">ForeignKey</span>(<span class="pl-v">Foo</span>.<span class="pl-s1">id</span>)) <span class="pl-s1">foo</span>: <span class="pl-v">Optional</span>[<span class="pl-v">Foo</span>] <span class="pl-c1">=</span> <span class="pl-en">relationship</span>(<span class="pl-s">"Foo"</span>, <span class="pl-s1">back_populates</span><span class="pl-c1">=</span><span class="pl-s">"bars"</span>)</pre></div> <p dir="auto">I find this problematic for a few reasons:</p> <ul dir="auto"> <li>it's error-prone: a mistake in the annotation (like <code class="notranslate">bars: "Bar"</code> above: it should be <code class="notranslate">bars: List["Bar"]</code>), despite the information presumably being known (e.g. the sqlalchemy-mypy plugin can infer the types correctly)</li> <li>it's redundant</li> <li>it's more verbose</li> </ul> <p dir="auto"><strong>Describe the solution you'd like</strong><br> It would be great if the mypy plugin could infer more types for these foreign key and relationship properties.</p> <p dir="auto"><strong>Describe alternatives you've considered</strong></p> <p dir="auto">Another option would be to require the annotations, but validate that they match the relationship/foreign key targets. This resolves our main concern that the annotations are error prone, but I'm not sure this redundancy is useful (unlike some cases with type annotations).</p> <p dir="auto"><strong>Additional context</strong></p> <p dir="auto">I tested the code above using the following versions:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="greenlet==1.0.0 mypy==0.812 mypy-extensions==0.4.3 SQLAlchemy==1.4.11 sqlalchemy2-stubs==0.0.1a4 typed-ast==1.4.3 typing-extensions==3.7.4.3"><pre class="notranslate"><code class="notranslate">greenlet==1.0.0 mypy==0.812 mypy-extensions==0.4.3 SQLAlchemy==1.4.11 sqlalchemy2-stubs==0.0.1a4 typed-ast==1.4.3 typing-extensions==3.7.4.3 </code></pre></div>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p> <p dir="auto"><a href="this">is all against sqlalchemy r1343. sqlite 3.3.5, MySQLdb 1.2.1g3, python2.4, gcc 4.0.1</a></p> <p dir="auto">The repro case is for sqlite. It outputs::</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" self.execute(statement, parameters, connection=connection, cursor=cursor, return_raw=True) File &quot;/home/robin/devel/sqlalchemy/lib/sqlalchemy/engine.py&quot;, line 692, in execute self._execute(cursor, statement, parameters) File &quot;/home/robin/devel/sqlalchemy/lib/sqlalchemy/engine.py&quot;, line 712, in _execute raise exceptions.SQLError(statement, parameters, e) sqlalchemy.exceptions.SQLError: (ProgrammingError) Incorrect number of bindings supplied. The current statement uses 2, and there are 3 supplied. 'INSERT INTO t1 (name, familyname, registered) VALUES (?, ?, current_timestamp)' ['simpson', '0000-00-00 00:00:00']('bart',)"><pre class="notranslate"><code class="notranslate"> self.execute(statement, parameters, connection=connection, cursor=cursor, return_raw=True) File "/home/robin/devel/sqlalchemy/lib/sqlalchemy/engine.py", line 692, in execute self._execute(cursor, statement, parameters) File "/home/robin/devel/sqlalchemy/lib/sqlalchemy/engine.py", line 712, in _execute raise exceptions.SQLError(statement, parameters, e) sqlalchemy.exceptions.SQLError: (ProgrammingError) Incorrect number of bindings supplied. The current statement uses 2, and there are 3 supplied. 'INSERT INTO t1 (name, familyname, registered) VALUES (?, ?, current_timestamp)' ['simpson', '0000-00-00 00:00:00']('bart',) </code></pre></div> <p dir="auto">After the patch I get::</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(1, u'bart', u'simpson', datetime.datetime(2006, 4, 27, 2, 23, 5))"><pre class="notranslate"><code class="notranslate">(1, u'bart', u'simpson', datetime.datetime(2006, 4, 27, 2, 23, 5)) </code></pre></div> <p dir="auto">Also tried this on MySQL 4.1 with NOW() and behaviour is similar before &amp; after patch.</p> <p dir="auto">The patch prevents SQLEngine._process_defaults from filling in column defaults for parameters that have been supplied at compile time. It's not quite right,<br> <strong>objectstore.PKTest.testprimarykey</strong> fails, and it looks like something subtle is going on with multivalue, or single value, PK's that use Sequence. There is coupling between ansisql and engine that I just don't understand, the single additional test failure I got with this patch said::</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="objectstore.PKTest.testprimarykey SQLError: (IntegrityError) multi.multi_id may not be NULL 'INSERT INTO multi (multi_rev, name, value) VALUES (?, ?, ?)' ['entry1', 'this is entry 1'](2,)"><pre class="notranslate"><code class="notranslate">objectstore.PKTest.testprimarykey SQLError: (IntegrityError) multi.multi_id may not be NULL 'INSERT INTO multi (multi_rev, name, value) VALUES (?, ?, ?)' ['entry1', 'this is entry 1'](2,) </code></pre></div> <p dir="auto">(can't find the attatchment button, I'll add the patch &amp; repro as comment)</p> <hr> <p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/165/repro_compiled_insertcase_sqlite.py">repro_compiled_insertcase_sqlite.py</a> | <a href="../wiki/imported_issue_attachments/165/compiled_insert_params_against_r1343.patch">compiled_insert_params_against_r1343.patch</a></p>
0
<h3 dir="auto">Bug summary</h3> <p dir="auto">When figure.autolayout is set to True the output in the EPS file becomes blank. The file is produced and no errors are mentioned.</p> <h3 dir="auto">Code for reproduction</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt plt.rc('text', usetex=True) plt.rcParams[&quot;figure.figsize&quot;] = [3.4, 2.47] plt.rcParams['figure.autolayout'] = True [Ignoring creation of data for plots] plt.plot(t,d,label='electron bunch energy density') plt.savefig('test.eps')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span> <span class="pl-s1">plt</span>.<span class="pl-en">rc</span>(<span class="pl-s">'text'</span>, <span class="pl-s1">usetex</span><span class="pl-c1">=</span><span class="pl-c1">True</span>) <span class="pl-s1">plt</span>.<span class="pl-s1">rcParams</span>[<span class="pl-s">"figure.figsize"</span>] <span class="pl-c1">=</span> [<span class="pl-c1">3.4</span>, <span class="pl-c1">2.47</span>] <span class="pl-s1">plt</span>.<span class="pl-s1">rcParams</span>[<span class="pl-s">'figure.autolayout'</span>] <span class="pl-c1">=</span> <span class="pl-c1">True</span> [<span class="pl-v">Ignoring</span> <span class="pl-s1">creation</span> <span class="pl-s1">of</span> <span class="pl-s1">data</span> <span class="pl-k">for</span> <span class="pl-s1">plots</span>] <span class="pl-s1">plt</span>.<span class="pl-en">plot</span>(<span class="pl-s1">t</span>,<span class="pl-s1">d</span>,<span class="pl-s1">label</span><span class="pl-c1">=</span><span class="pl-s">'electron bunch energy density'</span>) <span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test.eps'</span>)</pre></div> <h3 dir="auto">Actual outcome</h3> <p dir="auto">EPS file converted to PDF</p> <p dir="auto"><a href="https://github.com/matplotlib/matplotlib/files/8480431/test.pdf">test.pdf</a></p> <h3 dir="auto">Expected outcome</h3> <p dir="auto">EPS file converted to PDF with <code class="notranslate">plt.rcParams['figure.autolayout'] = False</code> and all else the same</p> <p dir="auto"><a href="https://github.com/matplotlib/matplotlib/files/8480446/test_false.pdf">test_false.pdf</a></p> <h3 dir="auto">Additional information</h3> <p dir="auto">The bug appears when I change to autolayout = True. I noticed there was an earlier bug fix for a very similar scenario (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="587300884" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/16898" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/16898/hovercard" href="https://github.com/matplotlib/matplotlib/issues/16898">#16898</a>) which seems to fix for the case where figure.autolayout = False.</p> <h3 dir="auto">Operating system</h3> <p dir="auto">HPE Cray Linux Environment</p> <h3 dir="auto">Matplotlib Version</h3> <p dir="auto">3.5.1</p> <h3 dir="auto">Matplotlib Backend</h3> <p dir="auto">module://matplotlib_inline.backend_inline</p> <h3 dir="auto">Python version</h3> <p dir="auto">3.8.5</p> <h3 dir="auto">Jupyter version</h3> <p dir="auto">3.2.9</p> <h3 dir="auto">Installation</h3> <p dir="auto">pip</p>
<h3 dir="auto">Bug summary</h3> <p dir="auto">Setting 'figure.autolayout' to 'True' removes most of the EPS savefig.</p> <h3 dir="auto">Code for reproduction</h3> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt plt.rcParams['figure.autolayout'] = 'True' plt.plot([1, 2, 3], [1, 2, 3], 'o-') plt.title(r'$\sum_{i=0}^{\infty} x_i$ just a test') plt.savefig('test2.eps', format='eps')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span> <span class="pl-s1">plt</span>.<span class="pl-s1">rcParams</span>[<span class="pl-s">'figure.autolayout'</span>] <span class="pl-c1">=</span> <span class="pl-s">'True'</span> <span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], <span class="pl-s">'o-'</span>) <span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">r'$\sum_{i=0}^{\infty} x_i$ just a test'</span>) <span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test2.eps'</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'eps'</span>)</pre></div> <h3 dir="auto">Actual outcome</h3> <p dir="auto">Actual image after being exported from gimp (300dpi)</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30732244/145681524-ace8a931-20c2-4fd3-86f7-4421e003b902.jpeg"><img src="https://user-images.githubusercontent.com/30732244/145681524-ace8a931-20c2-4fd3-86f7-4421e003b902.jpeg" alt="actual" style="max-width: 100%;"></a></p> <p dir="auto">This is the EPS file:<br> <a href="https://we.tl/t-ka6aoUGxKm" rel="nofollow">https://we.tl/t-ka6aoUGxKm</a></p> <h3 dir="auto">Expected outcome</h3> <p dir="auto">Expect the image in ".eps" file like this.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/30732244/145681516-61387c50-b4d5-4e35-9658-12aab0383c7c.jpeg"><img src="https://user-images.githubusercontent.com/30732244/145681516-61387c50-b4d5-4e35-9658-12aab0383c7c.jpeg" alt="expected" style="max-width: 100%;"></a></p> <p dir="auto">This is the EPS file:<br> <a href="https://we.tl/t-Q7WBPMwDcy" rel="nofollow">https://we.tl/t-Q7WBPMwDcy</a></p> <h3 dir="auto">Additional information</h3> <p dir="auto">I found this bug by an accident while using a custom ".mplstyle" on Matplotlib 3.5.0<br> Seems like this rcParam <code class="notranslate">['figure.autolayout'] = 'True'</code> destroys about 2/3 of the eps file.<br> <code class="notranslate">plt.tightlayout()</code> seem to not affect the result, the bug happens only with this rcParam on the latest matplotlib version.</p> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt plt.plot([1, 2, 3], [1, 2, 3], 'o-') plt.title(r'$\sum_{i=0}^{\infty} x_i$ just a test') plt.savefig('test2.eps', format='eps')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span> <span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], [<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>], <span class="pl-s">'o-'</span>) <span class="pl-s1">plt</span>.<span class="pl-en">title</span>(<span class="pl-s">r'$\sum_{i=0}^{\infty} x_i$ just a test'</span>) <span class="pl-s1">plt</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'test2.eps'</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'eps'</span>)</pre></div> <p dir="auto">This is the code for the expected outcome.</p> <h3 dir="auto">Operating system</h3> <p dir="auto">Windows</p> <h3 dir="auto">Matplotlib Version</h3> <p dir="auto">Bug present only on 3.5.0</p> <h3 dir="auto">Matplotlib Backend</h3> <p dir="auto">Qt5Agg</p> <h3 dir="auto">Python version</h3> <p dir="auto">Tested with 3.10 and 3.9</p> <h3 dir="auto">Jupyter version</h3> <p dir="auto"><em>No response</em></p> <h3 dir="auto">Installation</h3> <p dir="auto">conda</p>
1
<p dir="auto">The current README.md file just has a few links and I think a better documentation with better wording would make the code more welcoming to beginners who wish to contribute.</p>
<h5 dir="auto">System information (version)</h5> <ul dir="auto"> <li>OpenCV =&gt; 4.0.1</li> <li>Operating System / Platform =&gt; Mac OS X 10.14</li> <li>Compiler =&gt; XCode 9.2</li> </ul> <h5 dir="auto">Detailed description</h5> <p dir="auto">cv::dnn::blobFromImage should support aspect-ratio resizing.<br> It currently warps the image by stretching it if you don't crop.<br> Making use of cv::copyMakeBorder is a workaround, but IMHO it could be part of the integrated preprocessing. This is especially important if your data has to keep aspect ratio inside the NN.</p> <h5 dir="auto">Steps to reproduce</h5> <p dir="auto">N.A.</p>
0