评价此页

ShapeEnvSettings#

class torch.fx.experimental.symbolic_shapes.ShapeEnvSettings(allow_scalar_outputs, allow_dynamic_output_shape_ops, assume_static_by_default, specialize_zero_one, duck_shape, prefer_deferred_runtime_asserts_over_guards, trace_asserts)[source]#

封装了所有可能影响 FakeTensor 分派的 shape env 设置。在创建分派缓存键时使用。