LDFLAGS += -lcairo
-all: flatland.so TAGS
+all: flatland_generator.so TAGS
TAGS: *.cc *.h
etags *.cc *.h
-flatland.so: sequence_generator.o misc.o \
+flatland_generator.so: sequence_generator.o misc.o \
universe.o \
polygon.o \
canvas.o canvas_cairo.o
print('__file__', __file__)
ffi = create_extension(
- '_ext.mylib',
- headers = [ 'mylib.h' ],
- sources = [ 'mylib.c' ],
- extra_objects = [ '/home/fleuret/sources/python/flatland/flatland.so' ],
+ '_ext.flatland',
+ headers = [ 'flatland.h' ],
+ sources = [ 'flatland.c' ],
+ extra_objects = [ '/home/fleuret/sources/python/flatland/flatland_generator.so' ],
libraries = [ ],
library_dirs = [ ],
define_macros = [ ],
*/
-#include "flatland.h"
+#include "sequence_generator.h"
int generate_sequence(long nb_sequences, THByteTensor *output) {
long nb_images_per_sequence = 5;
######################################################################
-from _ext import mylib
+from _ext import flatland
x = torch.ByteTensor()
-mylib.generate_sequence(10, x)
+flatland.generate_sequence(10, x)
sequences_to_image(x).save('sequences.png')