Python : Custom Attribute for Vertices I want to store custom Vector attribute for each vertex (custom vertex positions). I want to get it through numpy as I have millions of vertices:
import bpy
import numpy

active_obj = bpy.context.active_object

active_obj.data.attributes.new(name='myAttribute', type='FLOAT_VECTOR', domain='POINT')

# set MAKES ERROR
test = numpy.empty(len(active_obj.data.vertices) * 3, dtype=numpy.float64)
active_obj.data.vertices.foreach_set('myAttribute', test)

# get MAKES ERROR
test2 = numpy.empty(len(active_obj.data.vertices) * 3, dtype=numpy.float64)
active_obj.data.vertices.foreach_get('myAttribute', test2)

I also found AttributeGroup.
https://docs.blender.org/api/current/bpy.types.AttributeGroup.html#bpy.types.AttributeGroup
Thanks to @scurest for answers in comments. Here is my working code now:
import bpy
import numpy

active_obj = bpy.context.active_object

active_obj.data.attributes.new(name='myAttribute', type='FLOAT_VECTOR', domain='POINT')

# set (you could also use numpy.empty)
test = numpy.zeros(len(active_obj.data.vertices) * 3, dtype=numpy.float32)
active_obj.data.attributes['myAttribute'].data.foreach_set('vector', test)

# get (you could also use numpy.empty)
test2 = numpy.zeros(len(active_obj.data.vertices) * 3, dtype=numpy.float32)
active_obj.data.attributes['myAttribute'].data.foreach_get('vector', test2)

Tested in Blender 2.92