Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
54 views

After converting module A to CPU, the origin parameter tensor still stays on the GPU? When it is released? Is it wrong if I reuse the parameter? My code: import torch.nn as nn class A(nn.Module): ...
jiwei zhang's user avatar
0 votes
2 answers
53 views

When I attempt to import a module from a local package (from core import config), VSCode's syntax highlighting isn't working. When hovering over config, it shows "config: Any" (the editor ...
Иван Чернецов's user avatar
0 votes
0 answers
84 views

I'm debugging a C++ program, and in order to do that, I'd like to have a look at objects, defined in imported libraries. However, the "Modules" window mentions some symbols not to be loaded ...
Dominique's user avatar
  • 17.6k
1 vote
1 answer
117 views

I’ve built a modular JavaFX application using JDK 21 and JavaFX SDK 21.0.1. The project runs perfectly inside my IDE (IntelliJ IDEA), but when I try to export it as a .jar file and run it outside the ...
Rohan's user avatar
  • 18
3913 votes
14 answers
2.8m views

What is __init__.py for in a Python source directory?
Mat's user avatar
  • 87.3k
1159 votes
33 answers
1.7m views

I am running Python 2.5. This is my folder tree: ptdraft/ nib.py simulations/ life/ life.py (I also have __init__.py in each folder, omitted here for readability) How do I import the ...
Ram Rachum's user avatar
  • 89.5k
0 votes
0 answers
107 views

I have some code I am working on that has a certain struct object Permissions:- // Stores permissions with a bit flag /// 1 << ? - Vote - Anyone with a weight > 0 can vote. /// 1 << ? -...
abelmarnk's user avatar
  • 109
1154 votes
26 answers
1.3m views

I want to detect whether module has changed. Now, using inotify is simple, you just need to know the directory you want to get notifications from. How do I retrieve a module's path in python?
Cheery's user avatar
  • 25.6k
0 votes
2 answers
114 views

I have a directory structure that can be simplified like this: test/ scripts/ a.py src/ b.py In a.py, I have the line: import src.b If I'm in the test directory, I want this ...
user1801359's user avatar
0 votes
0 answers
26 views

I hope you can help me with one, it's drivinig me crazy :( I recently splitted a giant file called admin.js into many modules, using these two WordPress functions: wp_register_script_module ...
Mauro Cassani's user avatar
15 votes
4 answers
6k views

I started learning matplotlib with the Python Data Science Handbook by Jake VanderPlas that starts with this code for importing and setting style: %matplotlib inline import matplotlib.pyplot as plt ...
Malihe Mahdavi sefat's user avatar
2 votes
1 answer
52 views

I encountered a weird problem about vscode breakpoints for python in an imported module. The module is in the subfolder 'src' of the working folder of the main program 'main.py'. Then the main program ...
Farn Wang's user avatar
  • 241
290 votes
8 answers
342k views

Starting with v1.11 Go added support for modules. Commands go mod init <package name> go build would generate go.mod and go.sum files that contain all found versions for the package ...
dimus's user avatar
  • 9,500
374 votes
17 answers
281k views

I need to do something like: if (condition) { import something from 'something'; } // ... if (something) { something.doStuff(); } The above code does not compile; it throws SyntaxError: ... '...
ericsoco's user avatar
  • 26.6k
0 votes
0 answers
74 views

I’m building a website using a custom Odoo module. I created a hero section on the homepage, and I can see it correctly at localhost:8070. The issue is that after making several changes and adding new ...
Kafiul Islam's user avatar
627 votes
22 answers
930k views

How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux? I'm trying to look for the source of the datetime module in particular, ...
Daryl Spitzer's user avatar
866 votes
10 answers
377k views

What's the difference between a module and package in Python? See also: What's the difference between "package" and "module"? (for other languages)
Dave's user avatar
  • 9,443
361 votes
27 answers
412k views

When I run the following command: sudo pip install python-ldap I get this error: In file included from Modules/LDAPObject.c:9: Modules/errors.h:8: fatal error: lber.h: No such file or directory How ...
VacuumTube's user avatar
  • 4,161
1 vote
1 answer
83 views

I have a helloWorld program with a package helloWorld |----- morestrings |------- reverse.go |------- reverse_test.go |--- hello.go |--- go.mod ...
GeoffRussell's user avatar
-3 votes
1 answer
62 views

Currently trying to make voice commands for my PC. Whenever I try to install any module's, I get WARNING: Ignoring invalid distribution ~ (C:\Users\Username\AppData\Local\Programs\Python\Python311\Lib\...
Hornet-from-a-game's user avatar
186 votes
11 answers
119k views

When I updated Angular from 7 to Angular 8, getting error for lazy loading modules I have tried the options, which are there in the angular upgradation guide Made the below changes: Before ...
RajuPedda's user avatar
  • 3,409
902 votes
6 answers
201k views

I'm still very confused about CommonJS, AMD and RequireJS, even after reading a lot. I know that CommonJS (formerly ServerJS) is a group for defining some JavaScript specifications (i.e. modules) when ...
gremo's user avatar
  • 48.9k
299 votes
10 answers
237k views

I have some code: baseTypes.ts export namespace Living.Things { export class Animal { move() { /* ... */ } } export class Plant { photosynthesize() { /* ... */ } } } dog.ts import b ...
Ryan Cavanaugh's user avatar
0 votes
1 answer
87 views

My goal I'm trying to make my actix-web code more readable and came up with the idea that I want to extend Result with methods that transform errors into actix specific ones with status code etc. (so ...
h-c's user avatar
  • 54
268 votes
21 answers
378k views

I am learning Node.js at the moment on Windows. Several modules are installed globally with npm.cmd, and Node.js failed to find the installed modules. Take Jade, for example, npm install jade -g Jade ...
Cosmore's user avatar
  • 3,271

1
2 3 4 5
455